bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: grep -r problem


From: Bob Proulx
Subject: Re: grep -r problem
Date: Sat, 10 May 2003 12:15:24 -0600
User-agent: Mutt/1.3.28i

Karl Berry wrote:
>       grep with -r wants directories
> Well ... I hate to beat a dead horse, and I know you know this, but
> ... technically, grep -r searches files too.  I mean, it doesn't
> ignore files :).  It just recurses into subdirs when it comes across
> them, instead of skipping them (as it does without -r).

That is why I said I was "attempting" to improve upon the
explaination.  I never claimed that I had actually improved upon
it. :-)

Yes, you are correct.  I agree completely and I should have said that.
(chuckle, chuckle) No one taking me to task about programs "wanting"
things?  I figured that would set off someone when I wrote that.
Rather like talking about submarines swimming.

> The traditional solution you mentioned:
>     find . -name '*.c' -print0 | xargs -r0 grep void
> is good, of course.  In this particular case,
>   find -name *.c | xargs grep void
> will work just as well, I think.  Unless you happen to have newlines in
> your .c filenames.

Let me take exception to not quoting the *.c in the above.  If there
are files in the current directory which match then syntax errors from
find would likely result.  But of course you already knew that too.  I
love these kinds of debates, where we both know what are typos. :-)

"Back in the day" you could rely upon the fact that people never put
funny characters in file names.  But now with the influx of new users
and samba and djgpp on windows and things like that I have been doing
my best to retrain myself to think of every filename as being
potentially hostile toward me.

Bob




reply via email to

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