bug-grep
[Top][All Lists]
Advanced

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

[bug-grep] RE: Grep for Windows bug report


From: El-Shamaa, Khaled (ICARDA)
Subject: [bug-grep] RE: Grep for Windows bug report
Date: Tue, 01 Feb 2005 13:04:22 +0200

Thanks for your assist, and yes it was my own fault.

-----Original Message-----
From: Julian Foad [mailto:address@hidden 
Sent: Sunday, January 16, 2005 4:01 PM
To: El-Shamaa, Khaled (ICARDA)
Cc: address@hidden; address@hidden
Subject: Re: Grep for Windows bug report

El-Shamaa, Khaled (ICARDA) wrote:
> At first I would like to thanks you for your effort in making great
grep
> tool available in windows OS, but while I use it I faced a bug I want
to
> report it:

Thanks for the praise.

Grep now has its own mailing list <address@hidden> so I am copying
this reply 
there.

> When I try to save grep output command into file I fail in the endless
> loop, I used a command like this (I use it to grep postnuke modules
> information in one click):
> 
> grep -R -E "modversion.'(name'|version'|contact')" * > modules.txt

I think the problem you have is not a bug in Grep.  You asked Grep to
find text 
in all the files in the current directory, while asking the operating
system to 
put the result into a file called "modules.txt" in the current
directory.  The 
way the operating system works is it creates "modules.txt" as an empty
file in 
the current directory before it runs "grep", and therefore Grep searches
in 
that file as well as the other files.  Each time it finds a matching
line in 
any file including modules.txt, a copy of the matching line gets added
to the 
end of modules.txt, and so the result is an endless loop as modules.txt
grows 
until the disk is full.

As for solutions ... you could use Grep's "--exclude=modules.txt"
option, or 
you could write the result to a a file in a different directory.

I hope this helps.

- Julian




reply via email to

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