If
If [ $1 –le 100 ];then echo ture;else echo false;fi
If [[ $1<=100 ]];then echo ture;else echo false;fi
Awk ‘BEGIN{test=100;if (test>90){print test;}}’
For:
For I in (seq 100);do echo $i;done
For ((i=1;i<=100;i++));do echo $i;done
For ((i=1;i<=100;i++));do echo $1;done
Awk ‘BEGIN{for (x=1;x<=100;x=x+1) {print x;}}’ filename
While:
i=1;while [ $i –le 5 ]
;
do echo $i;((i= +1));done
awk ‘BEGIN{test=100;while (i<test){i++ ;print i}}’
awk ‘BEGIN{test=100;i=1;do {printf test “\t\n”;i++} while (i<test){printf “done”;}}’
转载于:https://blog.51cto.com/donex/774446