Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Mar 2007 15:16:41 -0700
From:      Garrett Cooper <youshi10@u.washington.edu>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Possible grep(1) bug or user error :)?
Message-ID:  <45FC68C9.9070502@u.washington.edu>
In-Reply-To: <20070317221443.GD82045@codelabs.ru>
References:  <45FC61FF.3090009@u.washington.edu> <20070317221443.GD82045@codelabs.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45FC68C9.9070502>