说我要touch
六个文件CONCAT字符串通过xargs的变量
one.html
one.css
two.html
two.css
three.html
three.css
如何使用xargs
这个?我正在查看手册页,但我不确定获取stdin管道的语法。
$ echo one two three | xargs -n 1 touch $1.html $1.css // nope
说我要touch
六个文件CONCAT字符串通过xargs的变量
one.html
one.css
two.html
two.css
three.html
three.css
如何使用xargs
这个?我正在查看手册页,但我不确定获取stdin管道的语法。
$ echo one two three | xargs -n 1 touch $1.html $1.css // nope
这是比较容易通过shell IST做:
touch {one,two,three}.{css,html}
这将创建6个文件:
one.css one.html two.css two.html three.css three.html
替代与循环
for f in one two three; do touch $f.html $f.css; done
如果是重要的是使用xargs
:
printf "%s\n" one two three | xargs -I{} touch {}.html {}.css
'max xargs' .... –