第2个回答 2012-05-27
#!/bin/bash
echo "Hello $LOGNAME"
hour=`date | cut -c 12-13`
if [ ${hour} -ge 0 -a ${hour} -le 11 ]
then
echo "Good Morning!"
elif [ ${hour} -ge 12 -a ${hour} -le 19 ]
then
echo "Good Afternoon!"
else
echo "Good Evening!"
fi本回答被提问者采纳