|
From: | Gordon Grimes |
Subject: | find: parameter order |
Date: | Thu, 04 Nov 2004 15:14:48 -0500 |
Hi,
I'm using GNU xargs version 4.1.7 and see the following strange
behavior. If one uses the -n or --max-args switches, along with --replace,
then the behavior depends upon the order of the parameters. I'm guessing that
one shouldn't use those with --replace as it sets the arg count automatically.
Nevertheless, the behavior below is undocumented and, IMO,
counter-intuitive. Note that the last two commands neglect to do the
replacement.
thanks,
gordon grimes
(Create a file "testinput" with "a", "b" and "c" on separate lines)
$ xargs -n 1 --replace=@ echo "( @ )" < testinput ( a ) ( b ) ( c ) $ xargs --max-args=1 --replace=@ echo "( @ )" < testinput ( a ) ( b ) ( c ) $ xargs --replace=@ echo "( @ )" < testinput ( a ) ( b ) ( c ) $ xargs --replace=@ -n 1 echo "( @ )" <
testinput
( @ ) a ( @ ) b ( @ ) c $ xargs --replace=@ --max-args=1 echo "( @ )" < testinput ( @ ) a ( @ ) b ( @ ) c |
[Prev in Thread] | Current Thread | [Next in Thread] |