Subject: Re: Suggestion: keep binary data out of /etc
To: proprietor - Foo Bar And Grill <greywolf@starwolf.com>
From: Bill Studenmund <skippy@macro.Stanford.EDU>
List: current-users
Date: 02/10/1999 11:30:02
On Tue, 9 Feb 1999, proprietor - Foo Bar And Grill wrote:
> I think the thing here is that he doesn't need to know the position,
> just that the pattern exists, and the context in which it exists.
The problem though is that grep's huristics of "context" fails on a binary
file. :-)
> I use grep like this all the time, although admittedly I'm using it
> on the output of strings. You can't really search the output of
> something such as, say, 'hexdump -c', because of its formatting.
> grep is about the only useful tool for looking for patterns on streaming
> output. sed is far too unwieldy for such a task.
>
> I must admit I don't quite grok for what he's searching, but I do think
> that there's something to being able to grep through files, i.e.
>
> grep foo *.o | grep -v bar
>
> main.o: ~r}iv0LMfoo@$#039c @(#) bar.c
> main.o: _h)@#$foo: cannot open bar file %s
>
> This would not work on output such as:
>
> main.o: "foo" found.
>
> Is this any clearer?
Oh, it's been clear all along. :-)
It's just that the "context" of these findings can be dangerous to some
terminal settings. Since they can cause a terminal to send replies to the
command line, they can be dangerous to the user('s files) as well.
:-)
Take care,
Bill