The /usr/bin/printf util argument list length is limited to the shell's maximum command line length, (i.e. getconf ARG_MAX, on my system that'd be 2097152); example:
# try using a list that's way too long
/usr/bin/printf '%s\n' $(seq $(( $(getconf ARG_MAX) * 2 ))) | tail -1
Output:
bash: /usr/bin/printf: Argument list too long
Today I'm informed that shell builtin printfs don't have that limit; test:
printf '%s\n' $(seq $(( $(getconf ARG_MAX) * 2 ))) | tail -1
Output:
4194304
Questions:
A skim of
man bash dashdoesn't seem to say much about this advantage of builtinprintf. Where is it documented?Do builtin
printfs (e.g.bash) have an argument list maximum length in chars, and if so, what is that length?