This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: grep = * vs grep = * > foo


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?

-- 
Jon H. LaBadie                  jcyg@jgcomp.com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]