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