Re: asm grep



Robert Redelmeier wrote:

....
Printing filename (really need to do that) and/or offset, or
just count, shouldn't be a problem... Printing non-matching
lines is going to require major modification

Why? just default to printing the line & skip if match.
Not much different to default to noprint and print if match.

The problem arises in that, in order to minimize checking "obvious non-matches", I scasb for the first character of "needle", completely ignoring "lines" (find the beginning/end of the line in which the match was found only after finding a match). Seems to me this isn't going to work if we want to print non-matching lines... *or* report line-number where a match is found, instead of "offset" (which seems useful to me).

- does anyone > actually use that?

Yes. I use -v when I need to filter out false positives:

$ grep sshd /var/log/messages* | grep -v Accept ; gives failed sshd

Damn! Well... it can be arranged...

I'm not familiar with "tr". You want to... strip the high bit
and then compare? Or strip the high bit from what we print?

strip, then compare.

Yeah? Okay... I'm not sure I see what this is used for...

Strip before printing would also be nice,
but that probably takes tr..

Well, we could surely build that into "our grep" if we wanted to (badly enough). Wouldn't be "the Unix way" (but then, neither is asm, as you've pointed out).

But... doesn't the "re" in "grep" stand for "regular expression"? I'm pretty sure regular expressions exceeds my ambition level (maybe my ability) at the moment...

I've had problems with binary files trashin'
my console... that might be a good one...

`reset` is your friend.

Yeah. It may have been you who taught me that.

Learn to type blind.

I may need to learn that anyway, the way I'm going... But it might be nice to have an option to avoid printing those "troublesome" characters in the first place...

Thanks for the feedback!

Best,
Frank
.