bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61356] The xargs -r, --no-run-if-empty Option Is Ignored When a De


From: 施军民
Subject: [bug #61356] The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed
Date: Tue, 19 Oct 2021 20:06:51 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0

URL:
  <https://savannah.gnu.org/bugs/?61356>

                 Summary: The xargs -r, --no-run-if-empty Option Is Ignored
When a Delimiter Is Passed
                 Project: findutils
            Submitted by: tongxiaoge
            Submitted on: Wed 20 Oct 2021 12:06:49 AM UTC
                Category: xargs
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: None
         Discussion Lock: Any
           Fixed Release: None

    _______________________________________________________

Details:

Hello,

When the -r, --no-run-if-empty option is combined with the -d, --delimiter
or -0, --null options, the -r, --no-run-if-empty option does not
take effect. The manual describes the intended behavior of the -r,
--no-run-if-empty option: "If the standard input does not contain any
nonblanks, do not run the command.  Normally, the command is run once even
if there is no input.  This option is a GNU extension."

The following command correctly outputs nothing.
xargs --no-run-if-empty -I str echo str <<< ""

The following command incorrectly outputs 1 empty line.
xargs --no-run-if-empty --delimiter="\n" -I str echo str <<< ""

The following command incorrectly outputs 2 empty lines.
xargs --no-run-if-empty --null -I str echo str <<< ""





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]