From owner-freebsd-questions@FreeBSD.ORG Sun Apr 4 20:56:41 2010 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 3B3ED106566C for ; Sun, 4 Apr 2010 20:56:41 +0000 (UTC) (envelope-from parv@pair.com) Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.124]) by mx1.freebsd.org (Postfix) with ESMTP id CECA08FC14 for ; Sun, 4 Apr 2010 20:56:40 +0000 (UTC) X-Authority-Analysis: v=1.1 cv=pKw63bS+wPQ6BxbjPFuXko/1Hb8f7lpGL8zfzHecwYY= c=1 sm=0 a=kj9zAlcOel0A:10 a=ipoArj6GrvOCo6ls3Bny8w==:17 a=rWdDcm16AAAA:8 a=0Wkxbn5hAAAA:8 a=eNcD7ojaAAAA:8 a=EQ83B0Zg7gwaywIwDKgA:9 a=NDKbDrDkC1YV5vrydCw0vJKzHWwA:4 a=CjuIK1q_8ugA:10 a=jgoaQNzrKcYA:10 a=ipoArj6GrvOCo6ls3Bny8w==:117 X-Cloudmark-Score: 0 X-Originating-IP: 72.130.250.48 Received: from [72.130.250.48] ([72.130.250.48:11562] helo=localhost.hawaii.res.rr.com) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id ED/0D-28165-70DF8BB4; Sun, 04 Apr 2010 20:56:40 +0000 Received: from holstein.holy.cow (parv [127.0.0.2]) by localhost.hawaii.res.rr.com (Postfix) with ESMTP id 29B035C76; Sun, 4 Apr 2010 10:58:37 -1000 (HST) Received: (from parv@localhost) by holstein.holy.cow (8.14.3/8.14.3/Submit) id o34KwZGS079196; Sun, 4 Apr 2010 10:58:35 -1000 (HST) (envelope-from parv@pair.com) X-Authentication-Warning: holstein.holy.cow: parv set sender to parv@pair.com using -f Date: Sun, 4 Apr 2010 10:58:35 -1000 From: parv@pair.com To: Gary Kline Message-ID: <20100404205835.GA34394@holstein.holy.cow> Mail-Followup-To: Gary Kline , "Randal L. Schwartz" , glarkin@FreeBSD.org, FreeBSD Mailing List References: <20100403210610.GA4135@thought.org> <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> <86aatjnsts.fsf@red.stonehenge.com> <20100404203951.GB47459@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100404203951.GB47459@thought.org> Cc: glarkin@FreeBSD.org, FreeBSD Mailing List , "Randal L. Schwartz" Subject: Re: perl qstn... 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: Sun, 04 Apr 2010 20:56:41 -0000 in message <20100404203951.GB47459@thought.org>, wrote Gary Kline thusly... > > ---Maybe you can clue me in on this one: around a dozen years ago > i somw found a recursive grep named tgrep online. to save tying, > i renamed it "rgr". i can start anywhere and 'rgr pattern' > --WITHOUT ANY ASTERISK-- will find any pattern and skip binary or > tarballs or compressed files. given this, rgr has become my > favorite utility, but since it doesn't have All of grep's > options, yes, it's tru e, there are times whrn i have to use the > real thing. i have searched for tgrep and cannot find a newer > more complete version. would you or anyone reading this know > where an upgraded version is? > > Here is the Usage string: > > p4 13:07 [5524] rgr > Usage: tgrep [-iredblLnf] regexp filepat ... > tgrep -h for help > > > if not for trgep/rgr my shoulder would've fallen off and just > laid on the floor; that's how much i use this script. having the > 'w' switch would be nice, so would the -N switch. What does "-N" do in grep included with FreeBSD? My version (FreeBSD 8) only has "-n". I know of one tcgrep (by Tom Christiansen) ... http://www.perl.com/CPAN/authors/id/TOMC/scripts/tcgrep.gz Then, there is ack ... http://search.cpan.org/dist/ack/ack ... may need to tinker with option to search non-Perl files (see -a option). Or, simply ... #!/bin/sh # If your particular egrep is laced with potent PCRE, may use -P # option (before "$@") to specify Perl regex. egrep -r $@ . - parv --