Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!rice!uw-beaver!milton!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.arch Subject: Re: shell architecture (to glob or not to glob) Message-ID: <1991Feb15.070845.27839@Think.COM> Date: 15 Feb 91 07:08:45 GMT References: <1991Feb14.024803.1252@Think.COM> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 31 In article kenw@skyler.arc.ab.ca (Ken Wallewein) writes: > On the other hand, am _I_ missing the whole point of the Unix Way to even >want this? Certainly there are workarounds -- shell loops, etc. The >questions is, are those workarounds really the Right Way, the way of Truth, >Beauty, and Simplicity? Or are they merely kludges? If you've read my past posts on the subject of globbing, you'd know that I am in favor of more context-sensitive wildcard matching. It would support more flexible use of wildcards (the "mv * *.old" example), and prevent globbing of non-filename arguments containing wildcard characters (such as the pattern argument to grep). I used to be a Multics programmer, and Multics successfully used a globbing library that was called by commands, rather than automatically globbing all arguments. But I also understand and appreciate the Unix Way, even though I don't agree with it. There's a consistency and simplicity to it. It guarantees that all commands will treat wildcards equivalently; most other mechanisms are susceptible to bugs due to the programmer failing to glob arguments, or doing it incorrectly. Variant of "mv" that support the above usage have been implemented as shell scripts, merely requiring that the user quote the arguments. Finally, by globbing in the shell, users may switch shells in order to get different globbing behavior (some shells have more elaborate wildcard patterns than others); dynamic linking may allow similar customization, but not many systems provide dynamic linking, and not all programs are distributed as dynamically-linked binaries. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar