*BSD News Article 83484


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!howland.erols.net!math.ohio-state.edu!jussieu.fr!rain.fr!francenet.fr!itesec!frmug.fr.net!xp11.frmug.org!not-for-mail
From: charnier@xp11.frmug.org (Ph. Charnier)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: cat foo* > foo.bar    causes infinite loop
Date: 20 Nov 1996 23:38:46 +0100
Organization: Ph. Charnier's InterNetNews site
Lines: 35
Message-ID: <xmk7mngxuh8.fsf@xp11.frmug.org>
References: <328A1236.32C4@pilot.msu.edu> <56vben$k8j@news1.iamerica.net>
X-Newsreader: Gnus v5.3/Emacs 19.34

AJ Musgrove <musgrove@xavier.varmm.com> writes:

> 
> Ed Symanzik <zik@pilot.msu.edu> 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".
> 
> I don't have a FreeBSD system here (its at home), but I just tried that on a
> Solaris box, and it worked exactly as it should. The contents of foo1, foo2,
> and foo3 where cat'ed into foo.bar
> 
> Sounds like a bug in the shell to me.
> 

# echo aaa > /tmp/a1
# echo bbb > /tmp/a2
# cat /tmp/a* | (sleep 2 ; cat) > /tmp/a3
# more /tmp/a3
aaa
bbb
# 

-- 
------                                                            ------ 
Philippe Charnier                               charnier@lirmm.fr (smtp)       
                                          charnier@xp11.frmug.org (uucp) 

    ``a PC not running FreeBSD is like a venusian with no tentacles'' 
------------------------------------------------------------------------