这按预期工作:
$ echo a b c | xargs --replace="{}" echo x "{}" y
x a b c y
Run Code Online (Sandbox Code Playgroud)
这也可以:
$ echo a b c | xargs --max-args=1 echo x
x a
x b
x c
Run Code Online (Sandbox Code Playgroud)
但这并没有按预期工作:
$ echo a b c | xargs --max-args=1 --replace="{}" echo x "{}" y
x a b c y
Run Code Online (Sandbox Code Playgroud)
这也没有:
$ echo a b c | xargs --delimiter=' ' --max-args=1 --replace="{}" echo x "{}" y
x a y
x b y
x c
y
Run Code Online (Sandbox Code Playgroud)
我期望这个输出: …