码迷,mamicode.com
首页 > 系统相关 > 详细

shell小程序

时间:2015-07-24 16:03:08      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:

#! /bin/sh
 
echo "Is it morning? Please answer yes or no."
read YES_OR_NO
if [ "$YES_OR_NO" = "yes" ]; then
  echo "Good morning!"
elif [ "$YES_OR_NO" = "no" ]; then
  echo "Good afternoon!"
else
  echo "Sorry, $YES_OR_NO not recognized. Enter yes or no."
  exit 1
fi
exit 0

shell小程序

标签:

原文地址:http://www.cnblogs.com/mickli/p/4673598.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!