sh-3.2# cat 1
#!/bin/bash
echo "please input a number:"
read line
if [ `expr $line % 2` -eq 0 ];then
echo oushu
else
echo jishu
fi
sh-3.2# sh 1
please input a number:
4
oushu
sh-3.2# sh 1
please input a number:
5
jishu
sh-3.2# cat 1
#!/bin/bash
echo "please input a number:"
read line
if [ `expr $line % 2` -eq 0 ];then
echo oushu
else
echo jishu
fi
sh-3.2# sh 1
please input a number:
4
oushu
sh-3.2# sh 1
please input a number:
5
jishu