Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] binary search of binary data



>>>>> "SJT" == Stephen J Turnbull <stephen@example.com> writes:

>>>>> "Edward" == Edward Wright <edw@example.com> writes:

    Edward> I use grep -ab for searching thru the file for text
    Edward> strings, but I couldn't see how to pass a binary search
    Edward> pattern to grep. Am I missing something simple here?

    SJT> That's not a grep problem, that's a shell problem!<0.9wink>

    SJT> I can think of a number of ways to deal with this.  First, almost all
    SJT> shells/terminal drivers allow entry of binary characters in some way,
    SJT> for example use ^V<control character> for the low range and ALT-###
    SJT> for the high range.  Some shells will interpret octal escapes for you,

I use shell inside emacs (M-x shell), and it never interprets any
special characters. Moreover, emacs allows you to enter control
characters directly (thru ^Q combination), so you can simply write

$ grep -a -b ^V^A input-file

    SJT> Unix rules, even when it sucks!

$ echo $TERM
dumb

Emacs rules even when it sucks :)

-- 
Viktor


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links