Re: [OFF-TOPIC] Grep question

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 11/17/97


On Mon, 17 Nov 1997, Jason Fischer wrote:

>I don't know who originally posted (the one that Sean is responding to)
>but yes, there is a version of grep abouts someplace (either that or I've
>been taking the same drugs as the original poster) that will skip binary
>files.  Also there is a way to check if a file is binary or not.  The file
>command (see man file) checks a file's magic number.  I see no reason why
>grep could do the same thing.

You could always make a wrapper for it.

if [ "`file $FILE | fgrep text`" ]; then
  grep the file
fi

All 'normal' files have "text" in their description.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST