我试图表明,如果您为该月键入一些内容,它会显示该月份,例如january=1
, february=2
, march=3
...
和年份2012
, 2013
, 2014
...
但是,如果您输入的内容超过12
了该月的内容,那么它应该告诉您"sorry"
并且我无法弄清楚如何使该消息起作用。
echo " please type a number for a month"
read month
echo " please type a number for a year"
read year
if [ "$month" = "1-12" ]
then
cal "$month" "$year"
sleep 2
echo " thank you, good bye... "
else
echo " sorry "
sleep 2
fi