On 2/22/08 11:31 AM +0100, Andreas Schwab wrote:
>Walt Pawley <[EMAIL PROTECTED]> writes:
>
>> I've had several occasions to want to extract the byte-offset
>> of a text string in a binary file. The various versions of grep
>> I've used won't provide that unless the file is treated as text
>> - printing a line indicating that the string is present.
>
>You can use -a to force treatment as non-binary.
'Tis certainly true but doesn't help much in some cases. The "line"
that accompanies the byte-offset is usually extraordinarily large.
I've successfully used grep -ab on selected files.
Another approach, perhaps much better than the original suggestion,
would be to have an option to suppress all found text ... leaving
only the output from other options. Or, make --context=NUM treat
NUM=0 as meaning no text.
--
Walter M. Pawley <[EMAIL PROTECTED]>
Wump Research & Company
676 River Bend Road, Roseburg, OR 97470
541-672-8975