摘要:
1.双尖括号 推荐采用 高级方法((expression))eg: C 语言风格 for循环for (( i = 1; i <= 10; i++))do echo "The next number is $i"done2.双方括号[[expression]]支持字符串模式匹配即正则表达式test命令的数值比较test 字符串比较老方法1)执行数学表达式 exprexpr 1+52)单方括号$[ operation ]eg:var=$[ 1+5 ]浮点数解决方法shell脚本支持整数的处理浮点数解决方法引入命令 bc 阅读全文
摘要:
IFS默认支持 空格 tab 换行符改变 IFSIFS=$'\n'IFS='\n'IFS=\nNormallybashdoesn't interpret escape sequences in string literals. So if you write\nor"\n"or'\n', that's not a linebreak - it's the lettern(in the first case) or a backslash followed by the lettern(in the ot 阅读全文