aboutsummaryrefslogtreecommitdiffstats
path: root/log_merge.sh
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-18 15:19:33 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-18 15:22:39 +0100
commitb537461a9c58fd5222d209e810d32b56a3afb8bc (patch)
tree306d77eb7f0ac0cfb5093d84b0555d47f14506d6 /log_merge.sh
parente1f9b74602f808edd6828d477169aafbb8938f4a (diff)
log_merge: Use shelcheck to harden the script
Diffstat (limited to 'log_merge.sh')
-rwxr-xr-xlog_merge.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/log_merge.sh b/log_merge.sh
index df52cfef..dee9cc2e 100755
--- a/log_merge.sh
+++ b/log_merge.sh
@@ -7,7 +7,7 @@
#
# the output files will be called "Module-Testcase.merged"
-if [ "x$1" == "x" ]; then
+if [ "x$1" = "x" ]; then
echo "You have to specify the Test Suite prefix"
exit 2
fi
@@ -15,16 +15,16 @@ fi
BASE_NAME="$1"
LOG_FILES="$BASE_NAME*.log"
-TEST_CASES=`ls -1 $LOG_FILES | awk 'BEGIN { FS = "-" } { print $2 }' | sort | uniq`
+TEST_CASES=$(ls -1 $LOG_FILES | awk 'BEGIN { FS = "-" } { print $2 }' | sort | uniq)
for t in $TEST_CASES; do
PREFIX="$BASE_NAME-$t"
OUTPUT="$BASE_NAME.$t.merged"
- ttcn3_logmerge $PREFIX-*.log > $OUTPUT
+ ttcn3_logmerge $PREFIX-*.log > "$OUTPUT"
echo "Generated $OUTPUT"
done
-if [ "$2" == "--rm" ]; then
+if [ "$2" = "--rm" ]; then
echo "Removing Input log files !!!"
- rm $LOG_FILES
+ rm "$LOG_FILES"
fi