管道导致的while循环体变量失效
摘要:
1 #!/bin/sh 2 num=0 3 cat /etc/passwd | while read line 4 do 5 num=$(($num+1)) 6 done 7 echo $num 8 9 linux:~ # sh a.sh10 0原因:使用for,while,until... 阅读全文
posted @ 2015-02-11 20:04 gzpk 阅读(305) 评论(0) 推荐(0)
浙公网安备 33010602011771号