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:
<
Actually, it's relatively easy:
... | sed 's/^/--prefix=/g' | xargs echo | xargs -I PARAMS your_cmd PARAMS
The sed 's/^/--prefix=/g'
is optional, in case you need to prefix each param with some --prefix=.
The xargs echo
turns the list of param lines (one param in each line) into a list of params in a single line and the xargs -I PARAMS your_cmd PARAMS
allows you to run a command, placing the params where ever you want.
So cat input.txt | sed 's/^/--file=/g' | xargs echo | xargs -I PARAMS my-program PARAMS
does what you need (assuming all lines within input.txt are simple and qualify as a single param value each).