test@hwy:~$ echo "//" | xargs -0
//
test@hwy:~$
为什么这里有换行?为什么结果不如下?
test@hwy:~$ echo "//" | xargs -0
//
test@hwy:~$
Man xargs无法告诉我原因。
-0 Input items are terminated by a null character instead of by
whitespace, and the quotes and backslash are not special (every
character is taken literally). Disables the end of file string,
which is treated like any other argument.
答案 0 :(得分:1)
echo
打印换行符,并告知xargs不考虑特殊字符。
您可以使用-n参数echo
获得想要的效果。