📅  最后修改于: 2022-03-11 14:50:43.041000             🧑  作者: Mango
# HOW TO FIND A NUMBER IS EVEN OR ODD IN SHELL SCRIPT
clear
echo "---- EVEN OR ODD IN SHELL SCRIPT -----"
echo -n "Enter a number:"
read n
echo -n "RESULT: "
if [ `expr $n % 2` == 0 ]
then
echo "$n is even"
else
echo "$n is Odd"
fi