Linux Shell 中写循环时,常常要用到变量的自增,现在总结一下整型变量自增的方法.我所知道的,bash中,目前有五种方法:1. i=`expr $i + 1`;2. let i+=1;3. ((i++));4. i=$[$i+1];5. i=$(( $i + 1 ))可以实践一下,简单的实例如下: #!/bin/bash i=0; while [ $i -lt 4 ]; do echo $i; i=`expr $i + 1`; # let i+=1; # ((i++)); # i=$[$…