Date: Sat, 21 Apr 2001 23:12:20 +0200 (CEST) From: Oliver Fromme <olli@secnetix.de> To: freebsd-current@FreeBSD.ORG Subject: Re: cp -d dir patch for review (or 'xargs'?) Message-ID: <200104212112.XAA22737@lurza.secnetix.de> In-Reply-To: <20010421201957.D12FD3E09@bazooka.unixfreak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Dima Dorfman <dima@unixfreak.org> wrote: > I don't have a copy of SuSv2 or anything else that defines -I and -i, http://www.secnetix.de/~olli/susv2/xcu/xargs.html > 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. Regards Oliver -- 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104212112.XAA22737>