假设我要touch
六个文件
one.html
one.css
two.html
two.css
three.html
three.css
我如何为此使用xargs
?我正在查看手册页,但不确定获取标准输入管道的语法。
$ echo one two three | xargs -n 1 touch $1.html $1.css // nope
最佳答案
如果使用xargs
很重要:
printf "%s\n" one two three | xargs -I{} touch {}.html {}.css
关于bash - 通过 xargs 连接带有变量的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39026100/