[ expression ] 用于test操作 n1 -eq n2 Check if n1 is equal to n2. n1 -ge n2 Check if n1 is greater than or equal to n2. n1 -gt n2 Check if n1 is greater than n2. n1 -le n2 Check if n1 is less than or equal to n2. n1 -lt n2 Check if n1 is less than n2. n1 -ne n2 Check if n1 is not equal to n2. str1 = str2 Check if str1 is the same as string str2. str1 != str2 Check if str1 is not th...
by 一路征程一路笑 - Linux文档专区 - 2008-11-29 19:52:20 阅读(846) 回复(0)
在shell编程中常常会遇到一些变态的符号,google查找有的也不方便,欢迎大家把linux shell编程中遇到的符号做个汇总重复的就不要发了 谢谢 小弟抛砖引玉 例如:匹配操作符~ 相当余== 例子:awk '$1 ~/xxx/' urfile相当于 awk '$1 == "xxx"' urfile 解释: 将显示第1个域中 与xxx相匹配的行
[ expression ] 用于test操作 n1 -eq n2 Check if n1 is equal to n2. n1 -ge n2 Check if n1 is greater than or equal to n2. n1 -gt n2 Check if n1 is greater than n2. n1 -le n2 Check if n1 is less than or equal to n2. n1 -lt n2 Check if n1 is less than n2. n1 -ne n2 Check if n1 is not equal to n2. str1 = str2 Check if str1 is the same as string str2. str1 != str2 Check if str1 is not the same a...
#!/bin/sh -f cat $1|while read LINE do echo $LINE done #!/bin/sh -f cat $argv【1】|while read LINE do echo $LINE done 为什么前者能正确执行,后者却不能?