OSDN Git Service

[fix] : Handle whitespace properly
authorhayao <hayao@fascode.net>
Thu, 11 Mar 2021 12:49:00 +0000 (21:49 +0900)
committerhayao <hayao@fascode.net>
Thu, 11 Mar 2021 12:49:00 +0000 (21:49 +0900)
tools/alteriso-info.sh

index 5126786..594ed54 100755 (executable)
@@ -24,7 +24,7 @@ _help() {
 ARGUMENT="${@}"
 OPTS="a:b:c:d:k:o:p:u:v:h"
 OPTL="arch:,boot-splash:,channel:,developer:,kernel:,os-name:,password:,username:,version:,help"
-if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+if ! OPT="$(getopt -o "${OPTS}" -l "${OPTL}" -- "${@}")"; then
     exit 1
 fi
 
@@ -32,7 +32,7 @@ eval set -- "${OPT}"
 unset OPT OPTS OPTL
 
 while true; do
-    case ${1} in
+    case "${1}" in
         -a | --arch)
             arch="${2}"
             shift 2