add missing double-quotes and use lower-case local variable names - fixes #271

Sun, 16 Jul 2023 13:10:50 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 16 Jul 2023 13:10:50 +0200
changeset 23
79ca64922cfa
parent 22
5432f41c4988
child 24
e7c0b50468ee

add missing double-quotes and use lower-case local variable names - fixes #271

dist/install.sh file | annotate | diff | comparison | revisions
--- a/dist/install.sh	Sat Jul 15 13:13:36 2023 +0200
+++ b/dist/install.sh	Sun Jul 16 13:10:50 2023 +0200
@@ -13,23 +13,22 @@
 #
 # parse arguments 
 #
-for ARG in $@
+for arg in "$@"
 do
-    case "$ARG" in
-		"PREFIX="*)         PREFIX=${ARG#PREFIX=} ;;
+    case "$arg" in
+		"PREFIX="*)         PREFIX=${arg#PREFIX=} ;;
 		"--help"*)          printhelp; exit 1 ;;
-		"-"*) echo "unknown option: $ARG"; exit 1 ;;
+		"-"*) echo "unknown option: $arg"; exit 1 ;;
 	esac
 done
 
-
 echo "mkdir -p /usr/lib/uwproj"
-mkdir -p $PREFIX/lib/uwproj
+mkdir -p "$PREFIX/lib/uwproj"
 
 echo "cp ../target/uwproj-0.1-jar-with-dependencies.jar /usr/lib/uwproj/uwproj-0.1.jar"
-cp ../target/uwproj-0.1-jar-with-dependencies.jar $PREFIX/lib/uwproj/uwproj-0.1.jar
+cp "../target/uwproj-0.1-jar-with-dependencies.jar" "$PREFIX/lib/uwproj/uwproj-0.1.jar"
 
 echo "cp bin/uwproj /usr/bin"
-sed s:%%PREFIX%%:$PREFIX:g bin/uwproj > $PREFIX/bin/uwproj
+sed "s:%%PREFIX%%:$PREFIX:g" "bin/uwproj" > "$PREFIX/bin/uwproj"
 
 

mercurial