Just a heads up on something I hadn't noticed: Bash (and dash) treat octal literals in printf precision inconsistently (using glibc -- not sure if it's a bug or GNUism on that end or the shell):
$ bash -c 'printf "<%.010d> <%.*d>\n" 1 010 1' <0000000001> <00000001> Zsh is also inconsistent, but in the reverse direction: $ zsh -c 'printf "<%.010d> <%.*d>\n" 1 010 1' <00000001> <0000000001> ksh93 of course follows its usual pattern of ignoring octal literals entirely: $ ksh -c 'printf "<%.010d> <%.*d>\n" 1 010 1' <0000000001> <0000000001> (...and if everybody else follows suit, they won't be missed. Worked out fine for ECMAScript5 strict.) -- Dan Douglas