+checkInt() {
+ # Desc: Checks if arg is integer
+ # Usage: checkInt arg
+ # Input: arg: integer
+ # Output: - return code 0 (if arg is integer)
+ # - return code 1 (if arg is not integer)
+ # Example: if ! checkInt $arg; then echo "not int"; fi;
+ # Version: 0.0.1
+ local returnState
+
+ #===Process Arg===
+ if [[ $# -ne 1 ]]; then
+ die "ERROR:Invalid number of arguments:$#";
+ fi;
+
+ RETEST1='^[0-9]+$'; # Regular Expression to test
+ if [[ ! $1 =~ $RETEST1 ]] ; then
+ returnState="false";
+ else
+ returnState="true";
+ fi;
+
+ #===Determine function return code===
+ if [ "$returnState" = "true" ]; then
+ return 0;
+ else
+ return 1;
+ fi;
+} # Checks if arg is integer