#! /bin/bash
printf "please input integer number:"
read num
if ((num ==1))
then
echo "num is 1"
elif ((num == 2))
then
echo "num is 2"
elif ((num == 3));then
echo "num is 3"
else
echo "num is other"
fi
脚本输出结果:
please input integer number:123
num is other