标签:eal user seq root 需要 done echo sys code
^Cecho ${#char}
;done
real 0m8.165s
user 0m0.224s
sys 0m4.935s
[root@dong 04]# time for i in $(seq 11111);do count=echo ${char}|wc -l
;done
real 0m26.291s
user 0m2.950s
sys 0m17.875s
[root@dong 04]# time for i in $(seq 11111);do count=echo ${char}|wc -m
;done
real 0m26.140s
user 0m3.130s
sys 0m17.769s
[root@dong 04]# time for i in $(seq 11111);do count=echo ${char}|wc -L
;done
real 0m26.604s
user 0m3.115s
sys 0m18.451s
[root@dong 04]# time for i in $(seq 11111);do count=expr length $char
;done
real 0m16.735s
user 0m1.701s
sys 0m13.930s
感觉,当一个命令需要输出的时候,能用命令自带的命令就不用管道输出。
标签:eal user seq root 需要 done echo sys code
原文地址:https://blog.51cto.com/6207422/2412030