xargs with multiple arguments

后端 未结 12 1780
独厮守ぢ
独厮守ぢ 2020-12-13 08:05

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:

<         


        
12条回答
  •  被撕碎了的回忆
    2020-12-13 09:02

    Nobody has mentioned echoing out from a loop yet, so I'll put that in for completeness sake (it would be my second approach, the sed one being the first):

    for line in $(< input.txt) ; do echo --file=$line ; done | xargs echo my-program
    

提交回复
热议问题