Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!bacchus!mwm From: mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) Newsgroups: comp.os.misc Subject: Re: Globbing Message-ID: Date: 18 Mar 91 22:00:44 GMT References: <17097@lanl.gov> <5H0ABE8@xds13.ferranti.com> Sender: news@pa.dec.com (News) Distribution: na Organization: Missionaria Phonibalonica Lines: 46 In-Reply-To: peter@ficc.ferranti.com's message of Fri, 15 Mar 91 20:05:22 GM In article <5H0ABE8@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes: > Even on systems that support globbing libraries, you run into this... > and unlike shell globbing you don't get the option of quoting them to > make them do what you want. > Not true. A shell metacharacter that says "Please glob this argument > for me" is possible. Yes, you do that in tcl. "eval [concat ls [glob *.c]]". And, of course, since the shell is doing the globbing you *can* implement this in UNIX. You can't in AmigaOS, VMS, or other systems where the program does the globbing. Sorry, but that's not true. I've been doing it on AmigaDOS. It's primitive, because the globbing tool is kludged, but it does work. All it takes are tools designed for handling multiple file arguments. > % diff foo.{new,old} But this *is* globbing. The implementation sucks, but it's similar to: 1> diff foo(new|old) Maybe we should define globbing. The discussion seems to imply that it's "regular expression matching against the local file system name space," with specific arguments that matching against other parts of the file system aren't globbing. A simple test shows that the file system name space (local or not) isn't involved in this operation. ? ls foo.* No match. ? echo foo.{new,old} foo.new foo.old That csh {,} mechanism is text manipulation; no pattern matching involved at all. You can tell what the results of this operator are going to be _without_ reference to the local file system (this isn't true for the AmigaDOS version); this makes it a different beast.