I want to check if the argument in my bash
script is a 5 digit integer.
if [ "$1" == [0-9][0-9][0-9][0-9][0-9] ]; then
echo "first arg is 5 digits"
else
echo "not 5 digits"
This doesn't work for me, is there an easier way to do this using a function expr
?
source
to share