From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 17 22:14:50 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 5AC4616A404 for ; Sat, 17 Mar 2007 22:14:50 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 1899713C468 for ; Sat, 17 Mar 2007 22:14:49 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1HShAm-000Ld9-1i; Sun, 18 Mar 2007 01:14:48 +0300 Date: Sun, 18 Mar 2007 01:14:43 +0300 From: Eygene Ryabinkin To: Garrett Cooper Message-ID: <20070317221443.GD82045@codelabs.ru> References: <45FC61FF.3090009@u.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <45FC61FF.3090009@u.washington.edu> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-2.2 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_40 Cc: freebsd-hackers@freebsd.org 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:14:50 -0000 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. -- Eygene