C/C++风格的for循环: for((i=0;i<=10;i++)); do echo $i done 有逻辑判断需要用两个括号括起来,逻辑处理指令之间用do和done包含. for in风格: for i in {1..100}; do echo $i done for f in `ls`; do echo $f done for i in $@; do echo i done for i in ./\*; do echo $i done