🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #318

Re: Bug/Feature in globbing

#318
From: David C Lawrence
Date: Fri, 14 Jul 1989 15:20
26 lines
1675 bytes
From: tektronix!tekcrl!tekfdi!videovax!bart@cis.ohio-state.edu  (Bart Massey)
Bart> 	   for i in *
Bart> 	   do
Bart> 		   cat $i
Bart> 	   done

In <8907141311.AA07040@aurel.caltech.edu> bfox@AUREL.CALTECH.EDU (Brian Fox):
BF> I'm really amazed that you would want this behaviour. In the above `for'
BF> command, with "nullglobok" non-null, and no files in the current
BF> directory, the `cat' would hang, waiting for input, since `$i' would
BF> expand to nothing.

Ugh.  I've never come up against a for loops that started with a null
item in sh programming, but is that really what it is supposed to do?
It seems to me that in the interests of logical sensibility and
similarity to many existing languages it shouldn't even enter the for
loop because it has nothing with which to iterate.

(Yes, I know the "existing languages" argument falls apart with those
languages which will always execute a for loop at least once even
when the terminating condition is already met.  That always seemed
like broken behaviour to me.)

Dave
--
 (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet"))
Technical Details
Message-ID: <TALE.89Jul14112022@imagine.pawl.rpi.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rpi!rpi.edu!tale
References: <5476@videovax.tv.Tek.com> <8907141311.AA07040@aurel.caltech.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rpi!rpi.edu!tale
From: tale@pawl.rpi.edu (David C Lawrence)
Newsgroups: gnu.bash.bug
Subject: Re: Bug/Feature in globbing
Message-ID: <TALE.89Jul14112022@imagine.pawl.rpi.edu>
Date: 14 Jul 89 15:20:22 GMT
References: <5476@videovax.tv.Tek.com> <8907141311.AA07040@aurel.caltech.edu>
Sender: usenet@rpi.edu
Reply-To: tale@pawl.rpi.edu
Distribution: gnu
Lines: 26
In-reply-to: bfox@AUREL.CALTECH.EDU's message of 14 Jul 89 13:11:37 GMT