bug-gnu-utils
[Top][All Lists]
Advanced

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

GNU grep 2.5.1


From: Marvin Hile
Subject: GNU grep 2.5.1
Date: Thu, 31 Mar 2005 19:12:41 -0500

I have quite a number of ~1 gigabyte data files on my system.
They have a certain internal structure, and each section starts
with a known pattern. This is so my software can "parse" them
quickly. To check to make sure they are not corrupted, I have
been doing

od -x bigDataFile | grep -c "aa55 0000 0490"

which gives me the answer 560912 when a file has not been
corrupted. This is fine but quite slow.

Today I decided that

grep -c "\xaa\x55\x00\x00\x04\x90" bigDataFile

should be faster. Well, it is faster, but it always says 0.

I have tried other switches, such as -ac and -Uc since
these are binary data files, but nothing seems to help.

When I tried

grep -c "\x55\x00\x00" bigDataFile

I got 90 for a result, but that is not right, either. I have
tried with and without the double quotes, I tried "U\0\0",
I tried everything I could think of, but to no avail.

When I tried

grep -c "\0" bigDataFile

it ran and ran and ran. It took much longer than the od -x,
so I gave up and hit cntl-c.


Am I doing something wrong or is this a bug?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]