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

"Koopal, Andre" via Bug reports for the GNU find utilities <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <CAEQNUEUeO4VfV6cLRDwNvmhdgyndDde=FPAna64FZj4L9caH8A@mail.gmail.com>
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

Without -i it uses the arguments by itself, but of course at the end

% echo a b c | gxargs -n 1 echo before {} after
before {} after a
before {} after b
before {} after c

Just -i does what I expect, but I needed them separate:

% echo a b c | gxargs -i echo before {} after
before a b c after

After playing a bit more I find that if the arguments are on lines by
itself it does work:

% /usr/bin/echo 'a\nb\nc' | gxargs -i -n 1 echo before {} after
before a after
before b after
before c after

Which if more complicated you can solve with xargs as well:

akoopal@asostats0-47% echo a b c | gxargs -n 1 | gxargs -n 1 -i echo before
{} after
before a after
before b after
before c after

This seems like a bug to me, can you investigate?

Regards,

André Koopal


-- 

<http://www.verizon.com>

André Koopal
System engineer
Infrastructure Management & Security
Global Operations | Verizon Wireline Network

O +31 20 711 6990
[email protected]

<http://www.facebook.com/verizon>   <http://twitter.com/verizon>
<http://www.linkedin.com/company/verizon>
<http://www.instagram.com/verizon>

======================================================================

Verizon Nederland B.V. - H.J.E. Wenckebachweg 123, 1096 AM, Amsterdam, the Netherlands - Commercial Register No. 34199467
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.