On 31/08/17 06:02, Eric Blake wrote: > On 08/30/2017 09:12 PM, Pádraig Brady wrote: > >>> FAIL: tests/ln/sf-1 >>> [...] >>> + printf %0*d 256 0 >>> ash: %0*d: invalid format >> >>> (I guess printf(1) in Busybox's "ash" does not accept this format). >> >> Indeed: >> $ sudo dnf install busybox >> $ busybox ash -c 'printf %0*d 256 0' >> ash: %0*d: invalid format >> >> Since this is the only ash specific issue it seems, I'll avoid like: >> >> -long_name=$(printf '%0*d' $name_max_plus1 0) >> +long_name=$(yes 0 | head -n$name_max_plus1 | tr -d '\n') > > Couldn't we also ensure that we are using coreutils' printf, as in $(env > printf '%0*d' ...), so that we aren't depending upon sh's builtins?
Indeed that would be best. I went with the more portable $(printf '%*s' $name_max_plus1 ...) before I received this. cheers, Pádraig
