From owner-freebsd-questions Tue Aug 6 14:39:26 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA29362 for questions-outgoing; Tue, 6 Aug 1996 14:39:26 -0700 (PDT) Received: from nwnexus.wa.com (nwnexus.wa.com [192.135.191.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id OAA29352 for ; Tue, 6 Aug 1996 14:39:23 -0700 (PDT) Received: from main.statsci.com ([206.63.206.110]) by nwnexus.wa.com with SMTP id AA26747 (5.65c/IDA-1.4.4 for ); Tue, 6 Aug 1996 14:39:13 -0700 Received: from statsci.com [206.63.206.4] with smtp by main.statsci.com with smtp (/\oo/\ Smail3.1.29.1 #29.3 #3) id m0unt7r-000QYIC; Tue, 6 Aug 96 13:53 PDT Message-Id: To: Nate Williams Cc: Brian Clapper , questions@freebsd.org Subject: Re: ``tgrep'' from Unix Power Tools References: <199608061813.OAA08918@telebase.com.> <199608061835.MAA28375@rocky.mt.sri.com> In-Reply-To: Your message of "Tue, 06 Aug 1996 12:35:57 -0600." <199608061835.MAA28375@rocky.mt.sri.com> Reply-To: scott@statsci.com Date: Tue, 06 Aug 1996 13:53:14 -0700 From: Scott Blachowicz Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Nate Williams wrote: > That's because those test requires the STDIO package that is used in > the original Unix, which was re-implemented by Chris Torke in 4.4BSD. > If you feel ambitious you could re-write the test using the internals of > the BSD stdio. See perl/perl/doio.c, and look for 'STDSTDIO'. Or the 'tgrep' script could be changed a little so as not to need the -T/-B file test operators. I've got a script (called 'rgrep') that I pulled from the net a long time ago that had the same problem. It's header comments go like this (in case it's an ancestor of your tgrep script): # @(#)rgrep version 3.4 created 5/19/93 ... # Written by Piet van Oostrum # This is really free software The way I worked around the problem was to have the code that cycles thru reading a file treat as binary any file containing a '\000' character (which I would expect to be a fairly common thing for a binary file and not for a text file). I could email/post my modified rgrep script for anyone who's interested. Scott Blachowicz Ph: 206/283-8802x240 Mathsoft (Data Analysis Products Div) 1700 Westlake Ave N #500 scott@statsci.com Seattle, WA USA 98109 Scott.Blachowicz@seaslug.org