bugfindutils - Bugs: bug #61356, The xargs -r, --no-run-if-empty...

 
 

bug #61356: The xargs -r, --no-run-if-empty Option Is Ignored When a Delimiter Is Passed

Submitter:  Mr. Shi <tongxiaoge>
Submitted:  Wed 20 Oct 2021 12:06:49 AM UTC
   
 
Category:  xargs Severity:  3 - Normal
Item Group:  Wrong result Status:  Working as Intended
Privacy:  Public Assigned to:  berny
Originator Name:  Open/Closed:  Closed
Release:  None Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 21 Oct 2021 09:34:40 PM UTC, comment #2: 

As Andreas pointed out with the link to the mailing list archive,
the problem is not in xargs, but in the wrong expectations of
how the shell operator <<<"" works.

Therefore, I'm hereby closing this issue as "Works as intended".

Bernhard Voelker <berny>
Group administrator
Wed 20 Oct 2021 05:02:11 PM UTC, comment #1: 
Andreas Metzler <ametzler>
Wed 20 Oct 2021 12:06:49 AM UTC, original submission:  

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

Mr. Shi <tongxiaoge>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by berny (Posted a comment)
  • -email is unavailable- added by tongxiaoge (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-21 berny StatusNone Working as Intended
        Assigned toNone berny
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code