From owner-freebsd-questions@FreeBSD.ORG Mon Jun 9 14:28:41 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509D71065671 for ; Mon, 9 Jun 2008 14:28:41 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id C0B7B8FC15 for ; Mon, 9 Jun 2008 14:28:40 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl116-224.kln.forthnet.gr [77.49.235.224]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-4) with ESMTP id m59ESSkU025012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 9 Jun 2008 17:28:35 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m59ESSa0063366; Mon, 9 Jun 2008 17:28:28 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m59ESRxF063365; Mon, 9 Jun 2008 17:28:27 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Simon Jolle sjolle References: <484C3CC4.7050107@webrz.net> <20080608201256.GA28987@ayn.mi.celestial.com> <484C3FB7.4080208@gmail.com> Date: Mon, 09 Jun 2008 17:28:27 +0300 In-Reply-To: <484C3FB7.4080208@gmail.com> (Simon Jolle's message of "Sun, 08 Jun 2008 22:23:19 +0200") Message-ID: <87k5gyn0ms.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m59ESSkU025012 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.745, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.65, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: Grep Guru X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2008 14:28:41 -0000 On Sun, 08 Jun 2008 22:23:19 +0200, Simon Jolle sjolle 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.