perl qstn...

parv at pair.com parv at pair.com
Sun Apr 4 20:56:41 UTC 2010


in message <20100404203951.GB47459 at 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 <tao> [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

-- 



More information about the freebsd-questions mailing list