bug-findutils
[Top][All Lists]
Advanced

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

Re: strange behavour with combining -i with -n 1 for xargs


From: Andreas Metzler
Subject: Re: strange behavour with combining -i with -n 1 for xargs
Date: Fri, 22 Oct 2021 18:04:26 +0200

On 2021-10-22 "Koopal, Andre via Bug reports for the GNU find utilities" 
<bug-findutils@gnu.org> wrote:
> I tried the following which didn't work as expected:

> % echo a b c | gxargs -n 1 -i echo before {} after
> before a b c after
[...]
> This seems like a bug to me, can you investigate?

Hello,

 -I replace-str
        Replace occurrences of replace-str in the initial-arguments with
        names read from standard input.  Also, unquoted  blanks  do  not
        terminate  input  items;  instead  the  separator is the newline
        character.  Implies -x and -L 1.
 -L max-lines
        Use at most max-lines nonblank input  lines  per  command  line.
        Trailing blanks cause an input line to be logically continued on
        the next input line.  Implies -x.
 -n max-args, --max-args=max-args
        Use  at  most  max-args  arguments per command line.  Fewer than
        max-args arguments will be used if the size (see the -s  option)
        is  exceeded, unless the -x option is given, in which case xargs
        will exit.

These options cannot be used together, since -I implies -L 1 and specifying
both -L and -n does not make sense.

Current xargs (4.8.0) will throw a warning on this input:
--------------
argenau:~> echo a b c | xargs -n 1 -i echo before {} after
xargs: warning: options --max-args and --replace/-I/-i are mutually
exclusive, ignoring previous --max-args value before a b c after
-------------

cu Andreas



reply via email to

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