Re: Possible grep(1) bug or user error :)?
- From: Garrett Cooper <youshi10@xxxxxxxxxxxxxxxx>
- Date: Sat, 17 Mar 2007 16:09:23 -0700
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@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Possible grep(1) bug or user error :)?
- From: Garrett Cooper
- Re: Possible grep(1) bug or user error :)?
- From: James Bailie
- Possible grep(1) bug or user error :)?
- Prev by Date: Re: Possible grep(1) bug or user error :)?
- Next by Date: Re: iSCSI boot mussings
- Previous by thread: Re: Possible grep(1) bug or user error :)?
- Next by thread: Re: Possible grep(1) bug or user error :)?
- Index(es):
Relevant Pages
|
|