4 ms·
'for x in $y; do printf "$a%s$b" "$x"; done' is used in the code already. I am proposing that it be changed to 'printf "$a%s$b" $y', which is also POSIX complia
by Hello71 7y ago
'for x in $y; do printf "$a%s$b" "$x"; done' is used in the code already. I am proposing that it be changed to 'printf "$a%s$b" $y', which is also POSIX compliant, shorter (even including a comment), and faster. I included the part about brace expansion as a side note, not proposing that it be used.
- acqq 7y ago> 'printf "$a%s$b" $y', which is also POSIX compliant, shorter Yes, indeed, thanks for pointing that, it's documented: "The format operand shall be reused as often as necessary to satisfy the argument operands." https://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/p...