Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!alberta!arcsun.arc.ab.ca!arcsun!kenw From: kenw@skyler.arc.ab.ca (Ken Wallewein) Newsgroups: comp.arch Subject: Re: shell architecture (to glob or not to glob) Message-ID: Date: 25 Feb 91 22:04:31 GMT References: <1991Jan14.013815.11419@ims.alaska.edu> <11314@lanl.gov> <5340@idunno.Princeton.EDU> <1991Jan14.170115.17178@Think.COM> <360@bria> <1991Jan17.185527.9824@Neon.Stanford.EDU> <365@bria> <378@bria> <19062@cbmvax.commo Sender: nobody@arc.ab.ca (Absolutely Nobody) Organization: Alberta Research Council, Calgary Alberta, Canada Lines: 42 In-Reply-To: bernie@metapro.DIALix.oz.au's message of 25 Feb 91 05:22:12 GMT > In article <1991Feb25.052212.2338@metapro.DIALix.oz.au> bernie@metapro.DIALix.oz.au (Bernd Felsche) writes: > > In <19062@cbmvax.commodore.com> > jesup@cbmvax.commodore.com (Randell Jesup) writes: > > > The classic problem with shell-provided globbing (and causes you to > >have to use escapes to avoid the shell globbing things that aren't filenames). > >If you have a richer expression space (ala regexp), you end up having to > >do a LOT of quoting. > > You don't have to escape it ad nauseum. A rich set of escapes can > potentially escape varying levels of glob patterns. e.g. UNIX's \'" > quoting. 1~ Sounds pretty confusing. And as you pass through levels, each level looses syntactical information that was available to the previous level. It can be difficult syntactically (read "impossible") to distinguish between expanded formerly-globbed arguments and multiple separate arguments. That's why some Unix commands which support a (possibly globbed) filespec, followed directory spec as the last argument, can't handle a globbed argument in that position. To me, loss of syntactical information is equally significant to "escape-nausea" (:-) as a problem with shell or preprocesssor-based globbing. Some sort of quoting or other syntactical convention could potentially bypass this broblem, making it possible to tell where the original argument was and how much of the command line it comprised. However, if would significantly increase the level of program-level parsing required. As a trivil but amusing example, the other day I had a file whose name started with '-'. There was no way to tell programs which expects shell globbing that "this is not a command option; this is a filename". Ambiguity... is sometimes the price we pay for generality. Globbing is handy, but it sure ain't perfect. Methinks it could be done better. -- /kenw Ken Wallewein A L B E R T A kenw@noah.arc.ab.ca <-- replies (if mailed) here, please R E S E A R C H (403)297-2660 C O U N C I L Brought to you by Super Global Mega Corp .com