Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!rutgers!njin!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul John Falstad) Newsgroups: comp.arch Subject: Re: UNIX mind-set -> OK, OK! Message-ID: <5340@idunno.Princeton.EDU> Date: 14 Jan 91 13:43:35 GMT References: <11305@lanl.gov> <1991Jan14.013815.11419@ims.alaska.edu> <11314@lanl.gov> Sender: news@idunno.Princeton.EDU Organization: Princeton University, Princeton, New Jersey Lines: 44 In article <11314@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >Yes, both of the shells that are bundled with versions of UNIX _do_ >automatically trash (that is, 'process') the command line arguments to >expand wildcards. Explains why I don't use the bundled command shells >much. What shells DO you use, may I ask? This is a choice that _should_ be left to the discretion of the >utility writer. This forces the user to remember, for each individual command, whether or not it processes wildcards. It also makes the utility writer have to worry about wildcarding in each program he writes. Plus, what if some programmer comes up with some brilliant new wildcard, say one that matches exactly the files you want, every time? In UNIX he can just incorporate it into a shell, and it will work fine with the binaries of all existing utilities. Otherwise, he will have to recompile all the utilities he uses with this new globbing routine, or just use this new routine with all future programs he writes. Then he gets to remember which ones have the new globbing, and which ones do not. This is not consistent. Having once been an Amiga programmer (which handled wildcards in the way you specify), I can say I greatly prefer the UNIX shells' approach. It is not the job of "cat", for example, to process command lines and scan directories to check for matching files, any more than it is the job of the shell to catenate files. In the "one tool = one job" approach, the shell handles the job of parsing and expanding command lines, and "cat" simply spits out files without having to scan directories or call any strange pattern matching library functions. If you don't want the shell to do wildcard expansion for certain commands (e.g. find, so that "find . -name *.c -print" works as expected), you could use an alias involving "set noglob"; also, there are shells available that let you say "noglob find", which prevents the shell from doing wildcard expansion whenever the command "find" is involved. -- "Uh, Air Zalagaza 612, we have engine failure and our port wing is about to drop off. We anticipate a crash situation at this time." The lavatory is engaged. From within, you hear what could be a pygmy hog giving birth to an unusually large litter.