xargs with multiple arguments
问题 I have a source input, input.txt a.txt b.txt c.txt I want to feed these input into a program as the following: my-program --file=a.txt --file=b.txt --file=c.txt So I try to use xargs , but with no luck. cat input.txt | xargs -i echo "my-program --file"{} It gives my-program --file=a.txt my-program --file=b.txt my-program --file=c.txt But I want my-program --file=a.txt --file=b.txt --file=c.txt Any idea? 回答1: None of the solutions given so far deals correctly with file names containing space.