[OpenWrt-Devel] [PATCH 2/4] scripts/clean-package.sh: Use read -r

Rosen Penev rosenp at gmail.com
Sun Dec 29 22:48:25 EST 2019


read will mangle backslashes.

Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 scripts/clean-package.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh
index 987e6685a8..e849c41afa 100755
--- a/scripts/clean-package.sh
+++ b/scripts/clean-package.sh
@@ -10,14 +10,14 @@ IFS=$'\n'
 }
 cat "$1" | (
 	cd "$2" || exit 1
-	while read entry; do
+	while read -r entry; do
 		[ -n "$entry" ] || break
 		[ -f "$entry" ] && rm -f $entry
 	done
 )
 sort -r "$1" | (
 	cd "$2" || exit 1
-	while read entry; do
+	while read -r entry; do
 		[ -n "$entry" ] || break
 		[ -d "$entry" ] && rmdir "$entry" > /dev/null 2>&1
 	done
-- 
2.24.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list