Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!usc!apple!uokmax!munnari.oz.au!brolga!lingua.cltr.uq.OZ.AU!root From: root@lingua.cltr.uq.OZ.AU (Hulk Hogan) Newsgroups: comp.os.misc Subject: Re: UNIX mind-set -> OK, OK! Summary: globbing is useful 99% of the time. Message-ID: <1991Jan15.222146.9697@lingua.cltr.uq.OZ.AU> Date: 15 Jan 91 22:21:46 GMT References: <1991Jan14.170115.17178@Think.COM> <11390@lanl.gov> <5371@idunno.Princeton.EDU> <1991Jan15.053904.2881@Think.COM> Organization: Centre for Language Teaching and Research, Uni of Queensland, AUSTRALIA. Lines: 66 barmar@think.com (Barry Margolin) writes: >[Note: followups directed to comp.os.misc.] >In article <5371@idunno.Princeton.EDU> subbarao@phoenix.Princeton.EDU (Kartik Subbarao) writes: >>In article <11390@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >[In response to one of my posts about commands controlling wildcard >expansion, rather than the shell blindly expanding all wildcards.] >>>I usually don't post to these wild flame-fest discussions (even those >>>I start!) except on weekends. But the above is the first intelligent >>>comment about wildcard 'globbing' that has been posted. I just wanted >>>to say "Bravo!" >>Yo, Jim. Ever heard of the ' and " characters? They _do_ come in handy when you >>don't wan't to glob part or all of a command line. >Why should the user have to type extra characters to tell the computer not >to do something, when it should know better all by itself. The computer is >supposed to *save* the user from having to worry about trivial details like >this. I disagree. Although it *sounds* right when someone says that a program should glob it's arguments, so that it only globs filename args, it won't work in practice. Whilst I'm all for a glob(3) call to aid programmers with filenames received interactively, making globbing arguments the responsibility of the program means that wildcarding won't be consistant across all programs, which I feel is much worse than being bitten very occasionally by unexpected wildcarding. As has already been pointed out, you'd have different amounts of globbing in different programs, some none, some just "?", some "*", some "[chars]", some "{string,string}" .... It would be a nightmare. You'd have to remember which programs had which globbing... Yuk. The only possibility would be a glob(3) routine used by all commands for consistent globbing, which all vendors would have to keep functionally identical (no value adding!) for the sake of the poor users. Every program ever written programs would have to be modified to use it, and if a new glob(3) was added on a machine which added the ability to negate single characters (with "[^chars]" as tcsh does), then all programs would have to be recompiled to access the new glob(3)... Maybe you could pop it into a shared library (on machines which support them), but it all seems like infinite effort for infinitesimal gain. I prefer to know that "I'm using sh, so I can do ? and * and [chars]" and "I'm under tcsh, I can do ?,*,[chars], [^chars], {string,string...} to ALL programs". When a new tcsh comes out with some new wildcard, I can use it on all programs then too. It's consistent. It works. Besides, aren't you overstating the importance of this? In my experience, the only times I've ever had to worry about this is with the "-name" option to find (find -name pattern .....), wildcards as arguments to the grep(1) family and not being able to use "-?" as a help option. This is at worst, a minor annoyance, and may be relieved by the ability to tell the shell which commands you don't want globbed, as is done in "zsh" by Paul Falstad (pfalstad@phoenix.Princeton.EDU). Maybe you have filenames with wildcard characters in them, or programs which require you to be able to send in "?", "*" or "[" characters on the command line? I don't. /\ndy -- Andrew M. Jones, Systems Programmer, Internet: andy@lingua.cltr.uq.oz.au Centre for Lang. Teaching & Research, Phone (Australia): (07) 365 6915 University of Queensland, St. Lucia, Phone (World): +61 7 365 6915 Brisbane, Qld. AUSTRALIA 4072 Fax: +61 7 365 7077 "No matter what hits the fan, it's never distributed evenly....."