----- Original Message ----- 
From: "Keith Daniels" <[email protected]>
To: "Reuben Thomas" <[email protected]>; "Keith Daniels"
<[email protected]>; <[email protected]>; <[email protected]>
Sent: Thursday, February 17, 2011 10:36 PM
Subject: [bug #32520] If you use --include -- grep does not recurse
allsubdirectires


> Follow-up Comment #4, bug #32520 (project grep):
>
> Hi Reuben
>
> I agree that it makes --include useless.  I decided that the person
writing
> the Info file believed it was supposed to work this way from reading this
clip
> from the info file:
>
> ------
> grep -rH 'hello' *.c
>
>      which merely looks for 'hello' in all files in the current
>      directory whose names end in '.c'.  Here the '-r' is probably
>      unnecessary, as recursion occurs only in the unlikely event that
>      one of '.c' files is a directory.
> ------
[chroot-i486] root:/tmp$ mkdir foo foo/bar
[chroot-i486] root:/tmp$ echo yup >foo/faz
[chroot-i486] root:/tmp$ echo yup >foo/bar/gaz
[chroot-i486] root:/tmp$ echo yup >foo/no
[chroot-i486] root:/tmp$ grep -r --include=*az yup .
./foo/bar/gaz:yup
./foo/faz:yup
[chroot-i486] root:/tmp$ grep --version
grep (GNU grep) 2.7

This is a vanilia grep-2.7
Gentoo grep-2.5.4 , Debian v5 grep-2.5.3 behave the same
So -r work with --include to my understanding

Gilles


Reply via email to