标签:shell
最近在看 Linux 程序设计,准备写成一个系列。把每天学到的记录下来。 以实际的例子为主。
语法
#用法 1statementstatement#用法 2statementstatementstatement
例子
#!/bin/shecho "Is it moring? Please answer yes or no"read timeofdayexit 0
echo "Is it morning? Please input yes or no?"read timeofday
echo "Is it morning? Please input yes or no?"read timeofday
read timeofday;;;;exit 0
输出:
barfud43
+case4: 将当前目录下的所有的.txt改名为 .gif
echo "Enter Password"read trythisecho "Congrats, password correct"
与while 相反,当条件不满足时一直运行,直到条件为真
read trythis
statement && statementstatement || statement
statement &&statement1statement2statement3...}
标签:shell
原文地址:http://blog.csdn.net/shoulinjun/article/details/41808985