[bug #62043] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed

Andreas Metzler <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Follow-up Comment #4, bug #62043 (project findutils):

[comment #3 comment #3:] by Stephane Chazelas
> The point is that with -d '\n' an input that contains one
> newline character has one empty record, and one with two
> newlines has 2 empty records and so on.

> With -0, an input with one newline character optionally
> followed by a NUL has one record made of one newline
> character, an input with one NUL has one empty record
> and so on.

> With -0/-d, only an empty input has no record.

After reading your comment thrice I have noted the misunderstanding, you are
trying to explain the behavior on *newline* characters in the input when -0 is
set.

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

cu Andreas

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62043>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.