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

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

Re: grep recursive scan failure


From: Charles Swiger
Subject: Re: grep recursive scan failure
Date: Sat, 24 Jul 2010 09:06:05 -0700

Hi, Rich:

On Jul 23, 2010, at 4:12 PM, Rich Leggitt wrote:
> Hello, didn't see this issue in the archive, apologies if it's a dupe.
> 
> In my tree is a 256Mb file consisting entirely of 0xFF bytes. Any recursive
> grep which includes this file prematurely terminates with  "grep: line too
> long" on stderr, causing some files not to be scanned.

What does 'grep --version' say?  I can't reproduce this locally, although I did 
manage to get grep using 1.2+ GB of VM usage while testing, so it's possible 
that process resource limitations might be affecting your situation [1]:

% grep -r 'somestring' /tmp/test
187.62s real  2.16s user  3.28s system  2%
% grep --version
grep (GNU grep) 2.5.1

My sample tree for testing was created by:

mkdir /tmp/test
dd if=/dev/zero count=256 bs=1m | tr '\000' '\377' > /tmp/test/testfile.txt
for n in `jot 10`; do dd if=/dev/random count=10 bs=1m > 
/tmp/test/otherfile.$n; done

Anyway, you should be able to use --exclude flag to grep as a workaround...

Regards,
-- 
-Chuck

[1] On another machine with more limited RAM and process datasize limit set to 
512MB, I get:

% grep -r 'somestring' /tmp/test
grep: memory exhausted
% grep --version
grep (GNU grep) 2.5.1-FreeBSD




reply via email to

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