(2)shell编程——if语句_macg_新浪博客http://blog.sina.com.cn/s/blog_6151984a0100ekl6.html shell编程——if语句转载 if 语句格式if 条件then Commandelse Commandfi 别忘了这个结尾If语句忘了结尾fitest.sh: line 14: syntax error: unexpected end of fi if 的三种条件表达式ifcommandthen if 函数then 命令执行成功,等于返回…
shell编程中条件表达式的使用 if 条件then Commandelse Commandfi 别忘了这个结尾 If语句忘了结尾fitest.sh: line 14: syntax error: unexpected end of fi if 的三种条件表达式 ifcommandthen if 函数then 命令执行成功,等于返回0 (比如grep ,找到匹配)执行失败,返回非0 (grep,没找到匹配) if [ expressi…