loong qiang
像风一样自由
摘要: 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 阅读全文
posted @ 2013-12-01 12:05 loong qiang 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-12-01 11:10 loong qiang 阅读(172) 评论(0) 推荐(0) 编辑