摘要: 新建一个test.sh文件 #!/bin/sh echo "1 : For Test" echo "2 : For nohup &" whiletrue do echo -n "please enter the number:" read line echo "$line" if[[ $line = 阅读全文
posted @ 2017-09-14 10:58 四叶草Grass 阅读(3859) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.jb51.net/article/56553.htm 前言: 无论什么编程语言都离不开条件判断。SHELL也不例外。 if list then do something here elif list then do another thing here else do 阅读全文
posted @ 2017-09-14 10:54 四叶草Grass 阅读(176) 评论(0) 推荐(0) 编辑
摘要: shell脚本报错:"[: =: unary operator expected" 在匹配字符串相等时,我用了类似这样的语句: if [ $STATUS == "OK" ]; then echo "OK" fi 在运行时出现了 [: =: unary operator expected 的错误,就一 阅读全文
posted @ 2017-09-14 10:47 四叶草Grass 阅读(351) 评论(0) 推荐(0) 编辑