shell根据时间发送上午下午晚上

#! /bin/bash
hour=`date +%H`
case "$hour"
in
0? |1[01] ) echo “good morning”;;
1[2-7] ) echo “good afternoon”;;
* ) echo “good evening”;;
esac

[li] ~> sh se

“good afternoon”


[li] ~> date
Fri Feb 22 14:16:38 CST 2013

posted on 2013-02-22 14:18  语辰  阅读(224)  评论(0编辑  收藏  举报