-0
: 当输入有特殊字符时,将其当作一般字符处理.
test@hwy:~$ echo "//" | xargs -0
//
test@hwy:~$
为何出现换行?
xargs为何换行了
-
- 帖子: 104
- 注册时间: 2016-07-08 17:43
- 系统: debian8
-
- 帖子: 2284
- 注册时间: 2013-05-26 6:58
- 系统: Debian 9
Re: xargs为何换行了
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. Useful when input items might contain white space, quote marks, or backslashes. The
GNU find -print0 option produces input suitable for this mode.
- lilydjwg
- 论坛版主
- 帖子: 4249
- 注册时间: 2009-04-11 23:46
- 系统: Arch Linux
- 联系:
Re: xargs为何换行了
第一个换行来自于你的 echo 调用(你可以用 echo -n 这样就没了),第二个来自于 xargs 调用的 echo。and executes the command (default is /bin/echo)