[Date Prev][Date Next][Thread Prev][Thread Next]
[Search]
[Date Index]
[Thread Index]
[FWP] Grepping only text files
>From vlb@cfcl.com Tue Jun 29 09:29:13 1999 - sorry for the delay]
Message-Id: <199906291619.MAA03774@mercury.rev.net>
Organization: Roanoke Electronic Village
I can't exactly figure out why [Unix] grep has never had a command
line switch [if not the default!] only to scan text files. I use the
following:
exec ("grep" , grep { not -B ; } @ARGV) ;
This is pretty crude with only one redeeming feature [aside from its
utility!]: the test has to be "not -B" -- "-T" won't do because it
depends on the [fairly likely?] fact that the numerous and largely
unparseable command-line options for grep will not collide with the
names of binary files in the current directory (and at least as a
practical-perl matter, it works for me).
/Bernie\
--
Bernie Cosell Roanoke Electronic Village
mailto:bernie@rev.net Roanoke, VA
==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org