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

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

Re: bug in fgrep from http://unxutils.sourceforge.net/


From: Chuck Swiger
Subject: Re: bug in fgrep from http://unxutils.sourceforge.net/
Date: Wed, 24 Aug 2005 13:22:51 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050801

Jack Thompson wrote:
Thanks for your quick reply.  My ESP is quite limited, so I better just
paste my command ...

fgrep -r "def" *.py
[ ... ]
When I work on UNIX systems, I usually just use find and pipe the files
through grep - maybe I'm not using fgrep right????

You can't combine shell expansion of the asterisk with -r, because -r wants the names of directories, whereas the "*.py" matches only Python files.

Consider the following:

        fgrep -r "def" .
        fgrep "def" *.py */*.py */*/*.py
        fgrep "def" **/*.py           # this depends on your shell
        find . -name "*.py" | xargs fgrep "def"
        find . -name "*.py" -print0 | xargs -0 fgrep "def"

--
-Chuck





reply via email to

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