用简单的test语句来判断是否闰年
#! /bin/bash
read -p "sd " year
if [ $((year%4)) -eq 0 -a $((year%100)) -ne 0 -o $((year%400)) -eq 0 ]
then
echo "是润年"
else
echo "不是闰年"
fi
判断一个数是否为偶数
#! /bin/bash
read -p "sd " a
if [ $a -ge 2 -a ((a%2)) -eq 0 ]
then
echo "是偶数"
else
echo "不是偶数"
fi
#! /bin/bash
read -p "sd " a
if [ $a -ge 2 -a $((a%2)) -eq 0 ]
then
echo "是偶数"
else
echo "不是偶数"
fi
if [ $a -ge 90 -a $a -le 100 ]
then
echo "A "
elif [ $a -ge 60 -a $a -le 89 ]
then
echo "B"
elif [ $a -ge 0 -a $a -le 59 ]
then
echo "C"
else
echo "review"
fi