shellcheck: fix minor issues
A few scripts were missing the proper #! which identified them
as shell scripts. Fixed this and the shellcheck errors that ended
up being raised.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I867786c5821b4bd0ef4b50de03c893a71301142b
diff --git a/generate_whitelist.sh b/generate_whitelist.sh
index 684248e..d7d2a71 100755
--- a/generate_whitelist.sh
+++ b/generate_whitelist.sh
@@ -1,9 +1,9 @@
-#/bin/sh
+#!/bin/sh
# Ensure some files have been passed.
-if [ "x$*" == "x" ]; then
+if [ -z "$*" ]; then
echo "Usage: $0 [whitelist_files+]" >&2
- exit -1
+ exit 1
fi
cat << EOF
@@ -19,7 +19,7 @@
# Sort the list [numerically].
# Remove any duplicates.
# Turn "a:b //<NetFn>:<Command>" -> "{ a, b }, //<NetFn>:<Command>"
-cat $* | sed "s/#.*//" | sed '/^$/d' | sort -n | uniq | sed "s/^/ { /" | \
+sed "s/#.*//" "$*" | sed '/^$/d' | sort -n | uniq | sed "s/^/ { /" | \
sed "s/\:\(....\)\(.*\)/ , \1 }, \2/"
cat << EOF