bugfindutils - Bugs: bug #58156, Order of xargs -L and -I flags...

 
 

bug #58156: Order of xargs -L and -I flags matters

Submitter:  David Hoese <djhoese>
Submitted:  Fri 10 Apr 2020 04:12:17 PM UTC
   
 
Category:  xargs Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Wrong result
Status:  Duplicate Privacy:  Public
Assigned to:  berny Originator Name: 
Open/Closed:  Closed Release:  4.5.11
Fixed Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 04 Jan 2021 11:28:37 PM UTC, comment #1: 

Marking this as a duplicate of
https://savannah. ... u.org/bugs/?52137

Bernhard Voelker <berny>
Group administrator
Fri 10 Apr 2020 04:12:17 PM UTC, original submission:  

I know the BUGS section of the man page mentions "The -L option is incompatible with the -I option, but perhaps should not be." So while I would expect the combination of the two to never work given that sentence in the man page, some coworkers have apparently been using them together for years. Here's an example with a three line file:


$ cat test.txt | xargs -I{} -L1 bash -c "echo {}"
{}
{}
{}
$ cat test.txt | xargs -L1 -I{} bash -c "echo {}"
a
b
c


It seems the order of the -L and -I arguments determines the output which was unexpected. This has been noticed on the xargs that comes with CentOS 6/7 and Ubuntu, but the BSD version that comes with OSX seems to not depend on the order.

Version info:

$ xargs --version
xargs (GNU findutils) 4.6.0.225-235f
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org ... censes/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.

David Hoese <djhoese>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    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.

     

    History

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-26 jay Open/ClosedOpen Closed
    2021-01-04 berny StatusNone Duplicate
        Assigned toNone berny
    2020-04-10 djhoese Carbon-Copy- Added rayg@

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code