*BSD News Article 83240


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!vixen.cso.uiuc.edu!ux4.cso.uiuc.edu!not-for-mail
From: haszlaki@students.uiuc.edu (eric richard haszlakiewicz)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: cat foo* > foo.bar    causes infinite loop
Date: 20 Nov 1996 03:48:31 GMT
Organization: University of Illinois at Urbana
Lines: 24
Message-ID: <56tv2f$npc@vixen.cso.uiuc.edu>
References: <328A1236.32C4@pilot.msu.edu> <56d9io$ijc@newshost.lanl.gov>
NNTP-Posting-Host: ux4.cso.uiuc.edu
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]

Charlie Sorsby (crs@lanl.gov) wrote:
: = If I create three files foo1, foo2, and foo3 then run the command
: = 
: =  cat foo* > foo.bar
: = 
: = in csh I get an infinite loop (at least until the partition fills up).
: = Seems to me that '*' should be evaluated before new files are created.
: = I have seen systems that don't behave this way give errors similar to
: = "can't open foo.bar for both input and output".

: FreeBSD (presently 2.1.5R) is my first experience wiht BSD 4.4.  My
: experience is with BSD 4.[123], Ultrix, SunOS, and the like.
: 
: I'll be interested to hear comments about this.

	hmmm... well under netbsd 
		cat foo* >> foo.bar
	loops if there are files that match foo* that aren't 0 length
	and you're using ksh or sh.  just one > doesn't work and tcsh
	spits out an error.  It sort of makes sense that it should
	loop though.

eric