Date: Mon, 09 Jun 2008 17:28:27 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Simon Jolle sjolle <urandomdev@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Grep Guru Message-ID: <87k5gyn0ms.fsf@kobe.laptop> In-Reply-To: <484C3FB7.4080208@gmail.com> (Simon Jolle's message of "Sun, 08 Jun 2008 22:23:19 %2B0200") References: <484C3CC4.7050107@webrz.net> <20080608201256.GA28987@ayn.mi.celestial.com> <484C3FB7.4080208@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 08 Jun 2008 22:23:19 +0200, Simon Jolle sjolle <urandomdev@gmail.com> wrote: > On 06/08/2008 10:12 PM, Bill Campbell wrote: >> On Sun, Jun 08, 2008, Jos Chrispijn wrote: >>> I tried to make a grep script on find a string in all files on path >>> ./ and down. It does anything exept searching in files and reporting >>> them. Is there a Grep Guru who can hint me out? Thanks, >> >> I expect you need something like: >> >> find . -type f -print0 | xargs -0 grep pattern > > Or install the GNU grep (from the man) > > -R, -r, --recursive > Read all files under each directory, recursively; this is > equivalent to the -d recurse option. /usr/bin/grep *is* GNU grep in FreeBSD: % keramida@kobe:/home/keramida$ grep --version % grep (GNU grep) 2.5.1-FreeBSD % % Copyright 1988, 1992-1999, 2000, 2001 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. % % keramida@kobe:/home/keramida$ AFAIK, Gabor Kovesdan is working on replacing grep(1) with a BSD-licensed implementation, but he also tries to keep UI compatibility as much as possible. So I guess the -r/-R option should work in that version too once it hits the tree.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87k5gyn0ms.fsf>