Possible grep(1) bug or user error :)?

Garrett Cooper youshi10 at u.washington.edu
Sat Mar 17 22:16:43 UTC 2007


Eygene Ryabinkin wrote:
> Garret,
> 
> Sat, Mar 17, 2007 at 02:47:43PM -0700, Garrett Cooper wrote:
>> I was recently grepping a directory and outputting to a file located in the 
>> same directory as follows:
>>
>> grep -ri {key} * > {key}.found
>>
>> The thing is that grep kept on feeding off of the {key}.found file and 
>> eventually ate up all the free space on the device (~12GB).
> 
> And what you expected? The file {key}.found was created prior to the
> expansion of '*', so grep was parsing that file and feeding it with
> the messages about the lines with {key} that were found. And these
> lines also provoked grep to add more lines about the {key} found, and
> so on. I think you got the idea of the infinite cycle you created.

Yeah, I did.. oh well, I'll mark this as user error. Amusing user error 
though ><..

-Garrett


More information about the freebsd-hackers mailing list