0
One more newbie question
echo "Enter an integer number"
read int
checkNum=$(( int % 2 ))
if [$checkNum -eq '0' ]; then
echo "the number is even"
else
echo "the number is odd"
fi
Error when I enter any number:
./test4.sh: line 9: [0: command not found the number is Odd
I think you forgot the spacing in your if, the correct would be
if [ $checkNum -eq '0' ]; then
– Denis Rudnei de Souza
It worked!!! Thank you... until you hit me with these spaces....
– Igor Galdencio Gonçalves