why `echo "//" | xargs -0` result in newline?

244 views Asked by At
test@hwy:~$ echo "//" | xargs -0
// 

test@hwy:~$ 

Why there is a newline here?Why the result is not as below?

test@hwy:~$ echo "//" | xargs -0
// 
test@hwy:~$ 

Man xargs can't tell me reason.

   -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

There are 1 answers

0
Paul Stelian On BEST ANSWER

echo prints a newline and xargs is told to not consider a special character.

You may get the wanted effect by using the -n parameter to echo.