2016-12-24 80 views
1
[email protected]:~$ echo "//" | xargs -0 
// 

[email protected]:~$ 

为什么有一个换行符在这里?为什么结果不如下?为什么`echo“//”| xargs -0`导致换行?

[email protected]:~$ echo "//" | xargs -0 
// 
[email protected]:~$ 

男人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. 

回答

1

echo打印换行和xargs的被告知不考虑特殊字符。

您可以通过使用-n参数echo得到想要的效果。

相关问题