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

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

George Greer  -   | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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