Dima Dorfman <[EMAIL PROTECTED]> wrote:
 > I don't have a copy of SuSv2 or anything else that defines -I and -i,


 > but from what I can gather, -i is the same as "-I {}" and -I allows
 > things like this:

Not exactly.  The difference is that the option-argument to
-i is optional and -- if present -- has to follow without
whitespace after the -i.  This is a violation of the common
utility syntax guidelines, but has been adopted by SUSv2
because it was widely implemented.

So ``-i'' is the same as ``-I {}'', and ``-i[]'' (no space!)
is the same as ``-I []''.

Unfortunately, when you use -i or -I, then each line from
stdin is used as a signle argument, and the utility is
invoked once for every line, unless I misunderstand what
SUSv2 is saying.  :-(

$ cat test
foo   bar
baz   bla
$ xargs -i echo XXX '{}' YYY < test
XXX foo   bar YYY
XXX baz   bla YYY

 > Does that mean everyone is blind and missed my arrogant cross-post of
 > the amazingly short patch to do this, or are we just interested in
 > discussing it and not testing the implementation? ;-)

I must have missed it, and I think it's at least a good
start.  :-)

The patch looks good.  At leat it would solve the problem
which this thread is about, although I think it doesn't
comply with SUSv2.


Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to