Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Wed, 9 Oct 2002 01:46:05 -0400
From: Christopher Faylor <cgf@redhat.com>
To: cygwin@cygwin.com
Subject: Re: grep = *  vs grep = * > foo
Message-ID: <20021009054605.GB24383@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20021009002305.79648.qmail@web40514.mail.yahoo.com> <20021009002731.GA25291@redhat.com> <20021009054202.GA859@butch.jgcomp.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20021009054202.GA859@butch.jgcomp.com>
User-Agent: Mutt/1.4i

On Wed, Oct 09, 2002 at 01:42:02AM -0400, Jon LaBadie wrote:
>On Tue, Oct 08, 2002 at 08:27:31PM -0400, Christopher Faylor wrote:
>> On Tue, Oct 08, 2002 at 05:23:05PM -0700, Sheryl McKeown wrote:
>> >grepping and redircting the output to a file
>> >causes a process loop that has to be killed
>> >
>> >17:17 0  [C:\Development\test]
>> >.grep = * > delme
>> >
>> >17:18 66048  [C:\Development\test]
>> >.^C
>> >
>> >What happens is that the grep starts reading the delme
>> >file and then reporting all those finds...
>> 
>> Right.  The file is created before grep is started so when grep expands
>> the '*' if finds delme and dutifully searches it...  forever.
>> 
>> >Ok, but the odd part this is, this behavior doesn't appear when using
>> >the bash shell (on the same XP box).
>> 
>> When run from the bash shell, bash itself first expands '*' and then
>> creates delme.  Since delme doesn't exist, it isn't searched.
>
>Would a similar endless loop occur if delme did exist
>and the redirection overwrote it?

Yes.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

