add modifed integer test function

This commit is contained in:
Asif Bacchus 2020-11-28 04:14:22 -07:00
parent 17ba3a6fbf
commit 6a7c9602d4
1 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,16 @@ convertCase () {
printf "%s" "$1" | tr "[:lower:]" "[:upper:]"
}
isInt () {
if ! [ "$1" -eq "$1" ] 2>/dev/null; then
# not a valid integer, return -1
echo -1
else
# valid integer, return it
echo "$1"
fi
}
# instantiate variables
sqlCmd='/tmp/cmd.sql'