bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find: parameter order


From: James Youngman
Subject: Re: find: parameter order
Date: Mon, 8 Nov 2004 19:11:17 +0000
User-agent: Mutt/1.3.28i

On Thu, Nov 04, 2004 at 03:14:48PM -0500, Gordon Grimes wrote:
>  
> Hi,

> I'm using GNU xargs version 4.1.7 and see the following strange
> behavior.  

findutils 4.1.7 is many years old now.  Everybody should consider
using at least 4.1.20.

> 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)

[ different results from the following commands ]

> $ xargs -n 1 --replace=@  echo "( @ )" < testinput
> $ xargs --max-args=1 --replace=@  echo "( @ )" < testinput
> $ xargs  --replace=@  echo "( @ )" < testinput
> $ xargs --replace=@  -n 1 echo "( @ )" < testinput
> $ xargs  --replace=@  --max-args=1 echo "( @ )" < testinput

This bug was fixed in January this year (see
http://savannah.gnu.org/patch/?func=detailitem&item_id=1500).  This
bug is fixed in findutils 4.2.0, which you can download from
ftp://alpha.gnu.org/.  There are later versions also.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]