wounded in the line of duty
Just numerically compare it to itself.
is_int() { if test ${1} -eq ${1} 2>/dev/null; then return 0 fi return 1 }
is_int ${var} && echo "that's an int"
More information about formatting options
Just numerically compare it
Just numerically compare it to itself.
is_int() {
if test ${1} -eq ${1} 2>/dev/null; then
return 0
fi
return 1
}
is_int ${var} && echo "that's an int"