I have browsed through many posts on Stack Overflow as well as a few related communities regarding the argument list too long
topic and I don't seem to clearly figure if the length restriction applies to shell builtins or not.
Let's say I want to pass a very long string to a command through standard input:
string="a very long list of words ..."
Can I say:
# not using double quotes around $string is deliberate
printf '%s\n' $string | cmd ...
or
cmd <<< $string
Or even pipe it to xargs
:
printf '%s\n' $string | xargs cmd ...
Can someone please clarify this?