From 6e5ef9793e6f80393d55101a99a5f5694c2175ae Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Sat, 29 Aug 2015 17:59:22 -0400 Subject: download script: fix standards compliance issues --- (limited to 'download') diff --git a/download b/download index c53a433..004c176 100755 --- a/download +++ b/download @@ -48,7 +48,7 @@ if [ "${1}" = "--noconfirm" ] || [ "${1}" = "-y" ]; then shift 1 fi -case ${@} in +case "${@}" in all) ;; list) @@ -60,10 +60,10 @@ case ${@} in exit ;; *) - for programme in ${@}; do - echo ${programmes} | grep -wq ${programme} || (printf "ERROR: Invalid programme '${programme}'. See ./download help.\n"; exit 1) + for programme in "${@}"; do + echo "${programmes}" | grep -wq "${programme}" || (printf "ERROR: Invalid programme '%s'. See ./download help.\n" "${programme}"; exit 1) done - programmes=${@} + programmes="${*}" ;; esac @@ -72,16 +72,16 @@ for programme in ${programmes}; do if [ "${noconfirm}" = "0" ]; then printf "Use \"./download --noconfirm\" or \"./download -y\" if you want to be rid of these confirmation dialogues.\n\n" if [ -d "${programme}/" ]; then - printf "A ${programme}/ directory already exists, delete it? [yN]: " - read answer + printf "A %s/ directory already exists, delete it? [yN]: " "${programme}" + read -r answer if [ "${answer}" = "y" ]; then - rm -Rf "${programme}/" && printf "Old ${programme} directory deleted.\n\n" + rm -Rf "${programme:?}" && printf "Old %s directory deleted.\n\n" "${programme}" else - printf "${programme} directory not deleted, and therefore not replaced.\n" + printf "%s directory not deleted, and therefore not replaced.\n" "${programme}" continue fi fi fi - ${download}/${programme} + "${download}/${programme}" done -- cgit v0.9.1