From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 17 22:16:42 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 E431A16A400 for ; Sat, 17 Mar 2007 22:16:42 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout2.cac.washington.edu (mxout2.cac.washington.edu [140.142.33.4]) by mx1.freebsd.org (Postfix) with ESMTP id B3C3D13C4AE for ; Sat, 17 Mar 2007 22:16:42 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9] (may be forged)) by mxout2.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2HMGgLO025852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 17 Mar 2007 15:16:42 -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 l2HMGfxh006852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 17 Mar 2007 15:16:42 -0700 Message-ID: <45FC68C9.9070502@u.washington.edu> Date: Sat, 17 Mar 2007 15:16:41 -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> <20070317221443.GD82045@codelabs.ru> In-Reply-To: <20070317221443.GD82045@codelabs.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.3.17.150434 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CHARSET_IS_KOI8R 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_CHARSET_FARAWAY 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 22:16:43 -0000 Eygene Ryabinkin wrote: > 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. Yeah, I did.. oh well, I'll mark this as user error. Amusing user error though ><.. -Garrett