I know I can solve this problem several ways, but I'm wondering if there is a way to do it using only bash built-ins, and if not, what is the most efficient way to do it.I have a file with contents likeAAAB C DDDFOO BARby which I only mean it has several lines and each line may or may not have spaces.  I want to run a command likecmd AAA B C DDD FOO BARIf I use cmd $(< file) I getcmd AAA B C DDD FOO BARand if I use cmd $(< file) I getcmd AAA B C DDD FOO BARHow do I get each line treated a exactly one parameter?
Command substitution: splitting on newline but not space
bash;command substitution
Looks like the canonical way to do this in bash is something likeunset argswhile IFS= read -r line; do     args+=($line) done < filecmd ${args[@]}or, if your version of bash has mapfile:mapfile -t args < filenamecmd ${args[@]}The only difference I can find between the mapfile and the while-read loop versus the one-liner(set -f; IFS=$'\n'; cmd $(<file))is that the former will convert a blank line to an empty argument, while the one-liner will ignore a blank line.  In this case the one-liner behavior is what I'd prefer anyway, so double bonus on it being compact.I would use IFS=$'\n' cmd $(<file) but it doesn't work, because $(<file) is interpreted to form the command line before IFS=$'\n' takes effect.Though it doesn't work in my case, I've now learned that a lot of tools support terminating lines with null (\000) instead of newline (\n) which does make a lot of this easier when dealing with, say, file names, which are common sources of these situations:find / -name '*.config' -print0 | xargs -0 md5feeds a list of fully-qualified file names as arguments to md5 without any globbing or interpolating or whatever. That leads to the non-built-in solutiontr \n \000 <file | xargs -0 cmdalthough this, too, ignores empty lines, though it does capture lines that have only whitespace.