为什么`echo "//" | xargs -0`导致换行?
why `echo "//" | xargs -0` result in newline?
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.
echo
打印换行符并告知 xargs 不考虑特殊字符。
使用-n参数到echo
可能会得到想要的效果。
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.
echo
打印换行符并告知 xargs 不考虑特殊字符。
使用-n参数到echo
可能会得到想要的效果。