我很难解决然后解决方案帮助
T=`date + %k`
if [ $t –ge 0 –a $t –le 12 ];
then
echo “Good Morning”
elif[ $t –ge 12 –a $t –le 14 ];
then
echo “Good Afternoon”
elif[ $t –ge 14 –a $t –le 18 ];
then
echo “Good Evening"
else
echo “Good night”
fi
输出:[:日期意外操作员
答案 0 :(得分:0)
t=`date +%k`
if [ $t -ge 0 -a $t -le 12 ];
then
echo "Good Morning"
elif [ $t -ge 12 -a $t -le 14 ];
then
echo "Good Afternoon"
elif [ $t -ge 14 -a $t -le 18 ];
then
echo "Good Evening"
else
echo "Goodnight"
fi