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

Garrett Cooper youshi10 at u.washington.edu
Sat Mar 17 21:47:45 UTC 2007


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).

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 (in 
error checking) 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 (i.e. the output file would automatically be added to 
--exclude's relevant array of non-searched arguments).

Thanks,
-Garrett


More information about the freebsd-hackers mailing list