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

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

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.

With neither -0/-d, an input like [newline][space][tab][newline]... has no
record, an input like '' ""  '' has 3 empty records.

So maybe a better wording could be:

-r: if the input doesn't contain any record/argument, do not run the command
once with no argument as is otherwise done by default for standard
compliance.

I would not mention *standard* input, as with -a, the input comes from a file
argument.

Note that with NetBSD xargs, the -r behaviour is the default (which makes it
non-POSIX-compliant). 

    _______________________________________________________

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.