From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 17 23:09:24 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F16FC16A400 for ; Sat, 17 Mar 2007 23:09:24 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id CDD1F13C4BA for ; Sat, 17 Mar 2007 23:09:24 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9] (may be forged)) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2HN9OP8019659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 17 Mar 2007 16:09:24 -0700 X-Auth-Received: from [192.168.10.41] (c-67-187-172-183.hsd1.ca.comcast.net [67.187.172.183]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2HN9NFr009539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 17 Mar 2007 16:09:24 -0700 Message-ID: <45FC7523.9050100@u.washington.edu> Date: Sat, 17 Mar 2007 16:09:23 -0700 From: Garrett Cooper User-Agent: Thunderbird 1.5.0.10 (X11/20070316) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <45FC61FF.3090009@u.washington.edu> <45FC69D5.3010406@mammothcheese.ca> In-Reply-To: <45FC69D5.3010406@mammothcheese.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.3.17.155934 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Subject: Re: Possible grep(1) bug or user error :)? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2007 23:09:25 -0000 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