码迷,mamicode.com
首页 > 其他好文 > 详细

shell脚本读取用户输入并与之交互

时间:2014-08-26 11:33:45      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:blog   ar   div   log   on   ad   c   har   用户   

举个栗子:

#! /bin/bash
echo -e "你真要想要执行此操作吗,yes or no?"
read Confirm
case $Confirm in
y|Y|yes|Yes)
echo "做你想做的事情吧"
;;
*)
echo "操作终止了!"
esac

  

shell脚本读取用户输入并与之交互

标签:blog   ar   div   log   on   ad   c   har   用户   

原文地址:http://www.cnblogs.com/joewu/p/3936701.html

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