1 2 3 4 5 6 7 8
#!/bin/sh # $(builtin): the classic fork-per-substitution cost. i=0 while [ $i -lt 20000 ]; do x=$(echo $i); y=$(printf '%05d' $i) i=$((i + 1)) done echo $x $y