linux for 的用法总结
one line
for file in $(ls *.gz); do gunzip -c $file > ${file%%.*} ;done
shell
#!/bin/bash for((i=1;i<=100;i++)); do echo $(expr $i \* 3 + 1); done
#!/bin/bash for i in $(seq 1 100) do echo $(expr $i \* 3 + 1); done
#!/bin/bash for i in {1..100} do echo $(expr $i \* 3 + 1); done
#!/bin/bash list="where are you from" for i in $list; do echo "$i is ok"; done
#!/bin/bash for i in f1 f2 f3 ; do echo $i is ok ; done
#!/bin/bash for file in /var/*; do echo $file is file path \! ; done
每天进步一点点,多思考,多总结
版权声明:本文为CNblog博主「zaituzhong」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。