摘要:
1. 条件测试格式 简单条件测试 if [ condition ] then commands fi 注意condition条件表达式在前后方括号之后和之前各有一个空格,否则会出现语法错误 逻辑与条件测试 if [ condition1 ] && [ condition2 ] then comman 阅读全文
摘要:
1. if-then 语句 if command then commands fi 2. if-then-else 语句 if command then commands else commands fi 3. if-then-elif-then-else 语句 if command1 then c 阅读全文
摘要:
1. 函数默认退出状态码 function isDirExist { local dir=$1 ls $dir } dir=/path/test/ isDirExist "$dir" if [ $? -eq 1 ] then echo "The $dir is not exist" exit fi 阅读全文