From ffc7579666ccb10fdd6db7e1a290db230afc7775 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 13 Aug 2020 23:53:51 -0600 Subject: [PATCH] func badParam: proper printf formatting --- pilerBackup/pilerbackup.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pilerBackup/pilerbackup.sh b/pilerBackup/pilerbackup.sh index 724dd9c..44b19b6 100755 --- a/pilerBackup/pilerbackup.sh +++ b/pilerBackup/pilerbackup.sh @@ -51,20 +51,20 @@ badDetails () { # bad parameter passed to script badParam () { if [ "$1" = "dne" ]; then - printf "${err}\nError: '%s %s'\n" "$2" "$3" + printf "\n%sError: '%s %s'\n" "$err" "$2" "$3" printf "file or directory does not exist.${norm}\n\n" exit 1 elif [ "$1" = "empty" ]; then - printf "${err}\nError: '%s' cannot have a NULL (empty) value.\n" "$2" - printf "${cyan}Please use '--help' for assistance${norm}\n\n" + printf "\n%sError: '%s' cannot have a NULL (empty) value.\n" "$err" "$2" + printf "%sPlease use '--help' for assistance%s\n\n" "$cyan" "$norm" exit 1 elif [ "$1" = "svc" ]; then - printf "${err}\nError: '%s %s': Service does not exist!${norm}\n\n" \ - "$2" "$3" + printf "\n%sError: '%s %s': Service does not exist!${norm}\n\n" \ + "$err" "$2" "$3" exit 1 elif [ "$1" = "user" ]; then - printf "${err}\nError: '%s %s': User does not exist!${norm}\n\n" \ - "$2" "$3" + printf "\n%sError: '%s %s': User does not exist!${norm}\n\n" \ + "$err" "$2" "$3" exit 1 fi }