Follow-up Comment #3, bug #52137 (project findutils):
Hello,
agreed regarding addition of warning and doc-update.
> "But I cannot see posix requiring that -I and -n must produce
> strange results, so xargs could go beyond posix and produce
> correct results in that case anyway."
Actually POSIX saying that -I and -n are mutually exclusive is not arbitrary.
The specification of -I and -n cannot be fullfilled at same time, except for
the degenerate case (one line with a single argument):
-I [...] utility is executed for each logical line from standard input.
Arguments in the standard input shall be separated only by unescaped [newline]
characters, not by [blank] characters.
-n [...] Invoke utility using as many standard input arguments as possible, up
to number arguments maximum.
Therefore because POSIX requires this behavior ...
ametzler@argenau:/tmp$ echo a b | xargs -n1 echo x
x a
x b
ametzler@argenau:/tmp$ echo a b | xargs -I {} echo x {}
x a b
... mixing -L and -n *must* produce strange results (or an error).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52137>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/