From 71f76441754f4cad453d55683b0bc68967723048 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 19 Sep 2018 15:44:32 -0600 Subject: [PATCH] Show scriptHelp if no parameters given. Redirect unknown parameters. --- backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index 143e93b..4c1d583 100755 --- a/backup.sh +++ b/backup.sh @@ -56,11 +56,11 @@ logFile="$scriptPath/${scriptName%.*}.log" # if no parameters provided, then show the help page and exit with error if [ -z $1 ]; then # show script help page - scriptHelp 1 + scriptHelp fi # use GetOpts to process parameters -while getopts 'l:' PARAMS; do +while getopts ':l:' PARAMS; do case "$PARAMS" in l) # use provided location for logFile