linux shell awk 流程控制语句(if,for,while,do)详细介绍(2)
real 0m0.003s user 0m0.003s sys 0m0.000s [chengmo@localhost nginx]# time(total=0;for i in $(seq 10000);do total=$(($total+i));done;echo $total;) 50005000 real 0m0.141s user 0m0.125s sys 0m0.008s 实现相
real 0m0.003s
user 0m0.003s
sys 0m0.000s
[chengmo@localhost nginx]# time(total=0;for i in $(seq 10000);do total=$(($total+i));done;echo $total;)
50005000
real 0m0.141s
user 0m0.125s
sys 0m0.008s
实现相同功能,可以看到awk实现的性能是shell的50倍!
精彩图集
精彩文章