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



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.
--
Eygene
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Why SlickEdit is superior to VIM and Emacs combined!
    ... > Post made at the risk of being apprehended for feeding ... > the trolls. ... >:h grep ...
    (comp.editors)
  • Re: Possible grep(1) bug or user error :)?
    ... The thing is that grep kept on feeding off of the.found file and eventually ate up all the free space on the device. ... Amusing user error though><.. ...
    (freebsd-hackers)
  • Re: Why SlickEdit is superior to VIM and Emacs combined!
    ... >> Post made at the risk of being apprehended for feeding ... >> the trolls. ... >> {start data from vims help file} ... have an internal grep. ...
    (comp.editors)
  • Possible grep(1) bug or user error :)?
    ... I was recently grepping a directory and outputting to a file located in the same directory as follows: ... The thing is that grep kept on feeding off of the.found file and eventually ate up all the free space on the device. ... Thankfully it wasn't one of my primary devices, so deleting it wasn't an issue. ... However I was wondering if this case should be considered and another option should be added to output grep info to a file, instead of /dev/stdout, which would affect the behavior of the --exclude flag. ...
    (freebsd-hackers)
  • Re: Possible grep(1) bug or user error :)?
    ... > The thing is that grep kept on feeding off of the.found file and ... > eventually ate up all the free space on the device. ... in the expansion. ...
    (freebsd-hackers)