Follow-up Comment #7, bug #62043 (project findutils): [comment #5 comment #5:] by Jay > [comment #4 comment #4:] Andreas writes: >> OTOH I am trying to fix the documentation of xargs' >> inconsistent behavior, imho these two commands should produce >> identical output both for consistency reasons and according to >> the documentation but do not: >> printf '\n' | xargs -r echo foo >> printf '\0' | xargs -0 echo foo > > These are not supposed to behave similarly. In its default > mode (without -d or -0), xargs does whitespace and quote > processing. [...] > You're right though; if the documentation does not make this > clear, we should fix the documentation.
I think I get it now. The major _relevant_ difference (apart from quoting) between -0/-d and default is: 0 default: args are separated by whitespace character*s* (plus leading/trailing whitespace is ignored) 0 -0/-d: args are separated by each single instance of NUL or -d's arg. >From which follows that it is impossible to pass empty arguments in default mode (without quoting). - Multiple adjacent whitespace characters (including \n) are collapsed so one ends up with the equivalent of totally empty input. cu Andreas _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?62043> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/