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
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;
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