[Top][All Lists]

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

Re: grep recursive problem

From: Eric Backus
Subject: Re: grep recursive problem
Date: Fri, 27 Aug 2004 14:22:04 -0700

"Stepan Kasal" <address@hidden> wrote in message
> Hello,
> On Fri, Aug 27, 2004 at 08:35:28AM -0400, address@hidden wrote:
> > C:\Visual Studio .NET 2003\Vc7>grep --recursive WM_PAINT *.h
> > grep: *.h: Invalid argument
> this searches for *.h in current dir.  There is no such file.
> > grep --recursive WM_PAINT *.h
> This doesn't search subdirectories.
> What you need is
> grep --recursive --include=*.h WM_PAINT
> The --include option is available in GNU grep version 2.5 and newer,
> so you have to upgrade.

Another possibility is

    find . -path '*.h' -print0 | xargs -0 grep WM_PAINT /dev/null

This doesn't require upgrading grep.

Eric Backus
R&D Design Engineer
Agilent Technologies, Inc.
425-356-6010 Tel

reply via email to

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