summaryrefslogtreecommitdiffhomepage
path: root/bench/getopts.sh
blob: 0510beed54e4b14d566ee15816a64489e672bb3c (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
# getopts over a short option string, 4000 times through the same words.
i=0
while [ $i -lt 12000 ]; do
    OPTIND=1
    set -- -a -b -c value
    while getopts abc: o; do :; done
    i=$((i + 1))
done
echo "$i $OPTIND"