Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery
From: allbery@ncoast.UUCP
Newsgroups: comp.unix.wizards
Subject: Re: globbing in the shell (Was Re: more rm insanity)
Message-ID: <6356@ncoast.UUCP>
Date: Sat, 5-Dec-87 13:14:21 EST
Article-I.D.: ncoast.6356
Posted: Sat Dec  5 13:14:21 1987
Date-Received: Sat, 12-Dec-87 05:07:51 EST
References: <1257@boulder.Colorado.EDU> <6840002@hpcllmv.HP.COM>
Reply-To: allbery@ncoast.UUCP (Brandon Allbery)
Followup-To: comp.unix.wizards
Organization: Cleveland Public Access UN*X, Cleveland, Oh
Lines: 41

As quoted from <12441@think.UUCP> by barmar@think.COM (Barry Margolin):
+---------------
| In article <6774@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes:
| >In fact that is a key "win" of UNIX over OSes that make applications deal with
| >globbing.
| 
| Ahah, now you've hit one of my favorite complaints about Unix.
| 
| I do NOT think it is such a win that wildcard expansion is done by the
| shell, at least not when it is done in the haphazard style that Unix
| shells use.  It assumes that all commands take filenames as arguments,
| and that any argument with wildcard characters is supposed to be a
| filename.
+---------------

A counterargument is taht your examples are contrary to the spirit of Unix;
in particular, allowing "who" to perform globbing on user names isn't a whole
lot different from "ls -[A-Za-z]".

+---------------
| Finally, even when an argument is a pathname, it is sometimes not
| allowed to be multiple files.  For example, diff takes pathnames, but
| it requires exactly two of them, and ar allows only one archive
| pathname to be specified.  On Multics, a command with a syntax like
| this can check whether the argument contains wildcards and complain.
+---------------

So, how many times have you abbreviated a filename which you know is unique
with a well-placed "*"?  I do it all the time, and I'd get mighty upset if
the shell were changed such that this wouldn't work in, for example, "cd".

As for your "smart shell" -- having worked on one, I can say that it's not
the best of solutions.  What should the default case be for a new command?
And have you *any* idea how much work it is to build command descriptions
for all the regular commands?  Not to mention describing the idiosyncracies
of various non-conformant commands (such as "tail -/[0-9]*[cbl]?f?/", or
(perhaps especially) "dd")?
-- 
Brandon S. Allbery		      necntc!ncoast!allbery@harvard.harvard.edu
 {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
			Moderator of comp.sources.misc