🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #314

Re: Bug/Feature in globbing

#314
From: Bart Massey
Date: Thu, 13 Jul 1989 22:37
32 lines
1646 bytes
In article <8907121835.AA02530@aurel.caltech.edu> bfox@aurel.caltech.edu writes:
> In csh, without `nonomatch' set, (note this could mean typing "unset
> nonomatch"!), then
> 	echo z*
> 	  -> echo: no match
> but
> 	echo v* z*
> 	  -> very virus
> This is ambiguous behaviour in my opinion.

Agreed.  But one of the biggest traps for beginners in Bourne Shell
programming is exemplified by the fact that you can't write
	for i in *
	do
		cat $i
	done
safely unless you're sure that there are files in the current directory.
IMHO, what's wanted is
	set nullglobok
which inhibits both "no match" errors (which are almost never what I want
in shell scripts anyway) and the funny behaviour of nonmatching patterns.

If "bash" (instead of "sh" (i.e. BASH emulating the Bourne Shell)) is
started non-interactively, then I would probably choose "nullglobok" to be
set by default.  But this is more a matter of taste.

I've taught quite a few people Bourne Shell programming, and it'd have been
a lot easier for me if this feature had been available...

					Bart Massey
					..tektronix!videovax.tv.tek.com!bart
					..tektronix!reed.bitnet!bart
Technical Details
Message-ID: <5476@videovax.tv.Tek.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!zephyr!tektronix!tekcrl!tekfdi!videovax!bart
References: <1897@prune.bbn.com> <8907121835.AA02530@aurel.caltech.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!zephyr!tektronix!tekcrl!tekfdi!videovax!bart
From: bart@videovax.tv.Tek.com (Bart Massey)
Newsgroups: gnu.bash.bug
Subject: Re: Bug/Feature in globbing
Message-ID: <5476@videovax.tv.Tek.com>
Date: 13 Jul 89 22:37:32 GMT
References: <1897@prune.bbn.com> <8907121835.AA02530@aurel.caltech.edu>
Reply-To: bart@videovax.tv.tek.com (Bart Massey)
Distribution: gnu
Organization: Tektronix TV Measurement Systems, Beaverton OR
Lines: 32