Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] binary search of binary data
- Date: Wed, 29 Dec 2004 14:04:33 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] binary search of binary data
- References: <20041225205936.GA2199@example.com><87llbjj4xw.fsf@example.com> <20041227145652.GC2199@example.com><87fz1rhy0m.fsf@example.com> <20041228041814.GD2199@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, linux)
>>>>> "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? That's not a grep problem, that's a shell problem!<0.9wink> I can think of a number of ways to deal with this. First, almost all shells/terminal drivers allow entry of binary characters in some way, for example use ^V<control character> for the low range and ALT-### for the high range. Some shells will interpret octal escapes for you, although I believe bash doesn't. Recent GNU greps support a --perl-regexp (-P) option; I don't know if that implies processing Perl string escapes, it may not. There's always the -f option to take the search pattern from a file. Finally, you can use 'grep -e `printf ...`'. Unix rules, even when it sucks! None of these are particularly satisfactory, which is why I suggested doing the whole thing in <scripted-language-with-initial-character-p- or-r-at-your-option>. (You could even use awk, etc.) -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- Follow-Ups:
- Re: [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Viktor Pavlenko
- References:
- [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Stephen J. Turnbull
- Re: [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Stephen J. Turnbull
- Re: [tlug] binary search of binary data
- From: Edward Wright
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] software patents in japan
- Next by Date: [tlug] Knoppix Hacks
- Previous by thread: Re: [tlug] binary search of binary data
- Next by thread: Re: [tlug] binary search of binary data
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links