[LEDE-DEV] [PATCH v2] Quote to prevent word splitting

Jan-Tarek Butt tarek at ring0.de
Sat Oct 1 16:32:12 PDT 2016


---
 scripts/combined-ext-image.sh | 2 +-
 scripts/combined-image.sh     | 2 +-
 scripts/ext-toolchain.sh      | 8 ++++----
 scripts/strip-kmod.sh         | 1 +
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/scripts/combined-ext-image.sh b/scripts/combined-ext-image.sh
index 0d7fded..6f35f25 100755
--- a/scripts/combined-ext-image.sh
+++ b/scripts/combined-ext-image.sh
@@ -48,7 +48,7 @@ while [ "$#" -gt 1 ]
       [ ! -f "$file" ] && echo "$ME: Not a valid file: $file" && usage
       FILES="$FILES $file"
       md5=$(cat "$file" | md5sum -)
-      printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> "$IMG_OUT"
+      printf "%-32s%08x%32s" "$filename" "$(stat -c "%s" "$file")" "${md5%% *}" >> "$IMG_OUT"
       shift 2
    done
 
diff --git a/scripts/combined-image.sh b/scripts/combined-image.sh
index 1eb0d95..6e2cf38 100644
--- a/scripts/combined-image.sh
+++ b/scripts/combined-image.sh
@@ -25,7 +25,7 @@ md5=$(cat "$kern" "$root" | md5sum -)
 #  <rootfs length>  length of rootfs encoded as zero padded 8 digit hex
 #  <md5sum>         checksum of the combined kernel and rootfs image
 ( printf "CI%08x%08x%32s" \
-	$(stat -c "%s" "$kern") $(stat -c "%s" "$root") "${md5%% *}" | \
+	"$(stat -c "%s" "$kern")" "$(stat -c "%s" "$root")" "${md5%% *}" | \
 	dd bs=$BLKSZ conv=sync;
   cat "$kern" "$root"
 ) > "${IMAGE}" 2>/dev/null
diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh
index 9cd6e45..2817b90 100755
--- a/scripts/ext-toolchain.sh
+++ b/scripts/ext-toolchain.sh
@@ -496,8 +496,8 @@ while [ -n "$1" ]; do
 
 		--print-bin)
 			if [ -z "$1" ]; then
-				echo "Available programs:"                      >&2
-				echo $(echo "$BIN_SPECS" | sed -ne 's#:.*$##p') >&2
+				echo "Available programs:"                        >&2
+				echo "$(echo "$BIN_SPECS" | sed -ne 's#:.*$##p')" >&2
 				exit 1
 			fi
 
@@ -507,8 +507,8 @@ while [ -n "$1" ]; do
 
 		--print-libs)
 			if [ -z "$1" ]; then
-				echo "Available libraries:"                     >&2
-				echo $(echo "$LIB_SPECS" | sed -ne 's#:.*$##p') >&2
+				echo "Available libraries:"                       >&2
+				echo "$(echo "$LIB_SPECS" | sed -ne 's#:.*$##p')" >&2
 				exit 1
 			fi
 
diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh
index ef35b82..4019f14 100755
--- a/scripts/strip-kmod.sh
+++ b/scripts/strip-kmod.sh
@@ -50,6 +50,7 @@ $3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ && !def[$3] {
 }
 ' > "$MODULE.tmp1"
 
+# shellcheck disable=SC2046
 "${CROSS}"objcopy `cat "${MODULE}".tmp1` "${MODULE}".tmp "${MODULE}".out
 mv "${MODULE}.out" "${MODULE}"
 rm -f "${MODULE}".t*
-- 
2.10.0




More information about the Lede-dev mailing list