X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/b8f798aa115328694754d1c343127440c270a83f..cdf058f49da79511145631f9c64e635dce7852a7:/unitproc/bktemp-checkAppFileDir diff --git a/unitproc/bktemp-checkAppFileDir b/unitproc/bktemp-checkAppFileDir index d2f58d2..94afbd8 100644 --- a/unitproc/bktemp-checkAppFileDir +++ b/unitproc/bktemp-checkAppFileDir @@ -38,7 +38,7 @@ checkapp() { checkfile() { # Desc: If arg is a file path, save result in assoc array 'fileRollCall' # Usage: checkfile arg1 arg2 arg3 ... - # Version: 0.1.1 + # Version: 0.1.2 # Input: global assoc. array 'fileRollCall' # Output: adds/updates key(value) to global assoc array 'fileRollCall'; # Output: returns 0 if app found, 1 otherwise @@ -50,6 +50,8 @@ checkfile() { if [ -f "$arg" ]; then fileRollCall["$arg"]="true"; if ! [ "$returnState" = "false" ]; then returnState="true"; fi; + elif [ -z "$arg" ]; then + fileRollCall["(no name)"]="false"; returnState="false"; else fileRollCall["$arg"]="false"; returnState="false"; fi; @@ -180,6 +182,8 @@ if ! displayMissing 1>/dev/null 2>&1; then echo "Something is missing!"; displayMissing; fi; +sleep 1; +myFile=""; if ! checkfile "$myFile"; then echo "An empty argument provided:$myFile"; displayMissing; fi; #==END sample code== # Author: Steven Baltaktei Sandoval