summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2018-07-20 20:42:58 +1000
committerBen Elliston <bje@gnu.org>2018-07-20 20:42:58 +1000
commit81651abb04defb181f9c98bfcc55e077dcaea452 (patch)
tree300b90580a8b470849582071d336944d8de3685b
parentde9a1cae6716032501e87fc6d80a527f21c786ca (diff)
downloaddejagnu-81651abb04defb181f9c98bfcc55e077dcaea452.tar.gz
dejagnu-81651abb04defb181f9c98bfcc55e077dcaea452.tar.bz2
dejagnu-81651abb04defb181f9c98bfcc55e077dcaea452.zip
* contrib/mysql/make-datafile.sh: Eliminate Shellcheck warnings.
* contrib/mysql/sum2xml.sh: Likewise. Silence these warnings: Double quote to prevent globbing and word splitting. [SC2086] See if you can use ${variable//search/replace} instead. [SC2001]
-rw-r--r--ChangeLog5
-rw-r--r--contrib/mysql/make-datafile.sh2
-rw-r--r--contrib/mysql/sum2xml.sh2
3 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d41f162..8272a3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2018-07-20 Ben Elliston <bje@gnu.org>
+ * contrib/mysql/make-datafile.sh: Eliminate Shellcheck warnings.
+ * contrib/mysql/sum2xml.sh: Likewise.
+
+2018-07-20 Ben Elliston <bje@gnu.org>
+
* contrib/compare_tests: Eliminate Shellcheck warnings.
* contrib/mysql/sum2xml.sh: Likewise.
diff --git a/contrib/mysql/make-datafile.sh b/contrib/mysql/make-datafile.sh
index dc40651..178cbe7 100644
--- a/contrib/mysql/make-datafile.sh
+++ b/contrib/mysql/make-datafile.sh
@@ -105,7 +105,7 @@ rm testrun.data
files=$(find . -maxdepth 1 -name '*.data' | tr '\n' ' ')
# Get all the versions in the files, we'll pad rows so all the rows match
-versions=$(cut -d ' ' -f 3 $files | sort -V | uniq | tr '\n' ' ')
+versions=$(cut -d ' ' -f 3 "$files" | sort -V | uniq | tr '\n' ' ')
for i in ${files}; do
for j in ${versions}; do
diff --git a/contrib/mysql/sum2xml.sh b/contrib/mysql/sum2xml.sh
index e8f49ee..acb7164 100644
--- a/contrib/mysql/sum2xml.sh
+++ b/contrib/mysql/sum2xml.sh
@@ -90,7 +90,7 @@ do
fi
echo -n "."
{ echo "<test>"; echo " <input></input>"; echo " <output></output>"; } >> "$outfile"
- result=$(echo "$line" | sed -e 's/: .*$//')
+ result=${line/: *//}
echo " <result>${result}</result>" >> "$outfile"
name=${line/^[A-Z]*: /}
{ echo " <name>${name}</name>"; echo " <prms_id></prms_id>"; echo "</test>"; } >> "$outfile"