appending file contents as parameter for unix shell command
问题 I'm looking for a unix shell command to append the contents of a file as the parameters of another shell command. For example: command << commandArguments.txt 回答1: xargs was built specifically for this: cat commandArguments.txt | xargs mycommand If you have multiple lines in the file, you can use xargs -L1 -P10 to run ten copies of your command at a time, in parallel. 回答2: xargs takes its standard in and formats it as positional parameters for a shell command. It was originally meant to deal