This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Question about version of GREP


That utility you mentioned looks like some custom windoze port of GREP.
It's not at all related to cygwin or GNU grep as far as I can tell,
so "upgrading to version 2.0" doesn't really apply in relation
to the grep that comes with cygwin.

Here's the one that comes with cygwin:

bash$ grep --version
grep (GNU grep) 2.4.2

Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


You can of course do recursive grep with cygwin, but you must do
it "unix style".  In other words, use multiple utilities... often
with pipes to pass information from one process to the next via
stdin/stdout.  In this case "find" coupled with "grep".

Here are two ways to do it, there are probably more.

find . -name '*.txt' -exec grep -n 'my string' {} \;

find . -type f -name '*.java' -print0 | xargs -0 -e grep -n -e 'my string'

See "man grep" or "grep --help" for options to pass to grep for case
insensitive searching, etc.

Troy

-----Original Message-----
From: Frazer, Ryan [mailto:RYAN.FRAZER@ca.com]
Sent: Monday, July 30, 2001 12:25 PM
To: 'cygwin@cygwin.com'
Subject: Question about version of GREP


I just downloaded Cygwin last week and I love it.  I'm mainly a Windows
person, but would like to be able to use Unix/Linux more, its just my job is
mostly Windows.  So, I won't go into the assistance I need installing Red
Hat Linux that I bought probably close to 2 years ago.

What I will ask, however, is can I update the version of GREP that came with
Cygwin?  I'd like to be able to use GREP to looking into subdirecties as
well.  I saw a GREP v2.0 that had added this functionality.  I found it at
http://www.interlog.com/~tcharron/grep.html.

Thanks for any guidance,

Ryan Frazer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]