diff options
author | Matteo Croce <mcroce@redhat.com> | 2018-04-10 00:48:11 +0200 |
---|---|---|
committer | Dee'Kej <deekej@linuxmail.org> | 2018-05-17 14:37:21 +0200 |
commit | beeec3c4050e2986f514725c92d1cb1d65005926 (patch) | |
tree | 7616c336ecf13f74ec2edf86e6867e89a04a71ba /lang.sh | |
parent | aed9dbbe5c70c973df0691b8d0e3565241120fe0 (diff) | |
download | initscripts-beeec3c4050e2986f514725c92d1cb1d65005926.tar initscripts-beeec3c4050e2986f514725c92d1cb1d65005926.tar.gz initscripts-beeec3c4050e2986f514725c92d1cb1d65005926.tar.bz2 initscripts-beeec3c4050e2986f514725c92d1cb1d65005926.tar.xz initscripts-beeec3c4050e2986f514725c92d1cb1d65005926.zip |
network-functions: use tr to upper case strings rather than awk
network-functions uses awk to tranform the mac address to upper case.
Replace awk with tr which is two order of magnitude faster:
$ time awk '{ print toupper($0) }' </usr/share/dict/words >/dev/null
real 0m0,227s
user 0m0,224s
sys 0m0,004s
$ time tr '[a-z]' '[A-Z]' </usr/share/dict/words >/dev/null
real 0m0,005s
user 0m0,000s
sys 0m0,005s
Also use here-strings instead of spawning a subshell and a pipe.
Signed-off-by: Matteo Croce <mcroce@redhat.com>
Diffstat (limited to 'lang.sh')
0 files changed, 0 insertions, 0 deletions