James Bailie wrote:
Garrett Cooper wrote:
 > 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).

The shell is redirecting stdout onto the found file before it is
expanding the glob patterns, so the found file is being included
in the expansion.  You can force the expansion to occur first if
you assign it to a variable:

sh:

FILES=*; grep -ri key $FILES > found

csh:

set FILES=*; grep -ri key $FILES > found

Hope this helps,

Thanks James :). That's another good solution for working around that.

-Garrett

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to