On Wed, Apr 28, 2004 at 10:33:13PM -0700, Larry Ozeran wrote:
> Thanks for the great discussion. I really appreciate everyone's ideas. 
> Unfortunately, it appears that find is using similar expansion of the * leading to 
> the same error.
> 
> [EMAIL PROTECTED] mailman]# find -iname \erro*.[1-4].[1-4] -print0 | xargs -r0 rm -f
> bash: /usr/bin/find: Argument list too long
> 
> [EMAIL PROTECTED] mailman]# find -iname \erro*.[1-4] -print0 | xargs -r0 rm -f
> bash: /usr/bin/find: Argument list too long

You *need* to put the pattern in quotes, because otherwise the shell
will perform wildcard expansion just the same way it was doing for the
rm command. Try 
find -iname 'erro*.[1-4].[1-4]' -print0 | xargs -r0 rm -f
This should stop the nasty expansion.

This was demonstrated implicitly before, as Foo Lim said:
> >
> >Try using xargs like this:
> >
> >find . -name "error*" | xargs rm
> >
> >You can also try doing it through the find command like this:
> >
> >find . -name "error*" -exec rm \{} \;

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
My key was last signed 10/14/2003. If you use GPG *please* see me about 
signing the key. ***** My computer can't give you viruses by email. ***

Attachment: signature.asc
Description: Digital signature

Reply via email to