From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e219d94b946dfc26 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Ada.Command_Line and wildcards References: <45dcaed8_6@news.bluewin.ch> <1172132169.423514.271890@s48g2000cws.googlegroups.com> <545bgvF1ttrphU1@mid.individual.net> <1495406.QZvfpqijrQ@linux1.krischik.com> From: Markus E Leypold Organization: N/A Date: Sat, 24 Feb 2007 17:16:28 +0100 Message-ID: <6w7iu7a5ur.fsf@hod.lan.m-e-leypold.de> User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:LlZWDeTPp/zGFNQ9atRwFZnKWHs= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.72.205.83 X-Trace: news.arcor-ip.de 1172333442 88.72.205.83 (24 Feb 2007 17:10:42 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news2.google.com comp.lang.ada:9491 Date: 2007-02-24T17:16:28+01:00 List-Id: Kilgallen@SpamCop.net (Larry Kilgallen) writes: > In article <1495406.QZvfpqijrQ@linux1.krischik.com>, Martin Krischik writes: >> Alex R. Mosteo wrote: >> >>>> Alas, no. >>>> I forgot to mention: I tested both programs on both Windows 98 and XP. >>> >>> It would be in unix. There, wildcard expansion is a shell matter. Windows >>> only half-faked it. >> >> No, The VMS also won't expand wildcard. In fact Unix shells are pretty alone >> here. And they got it wrong. Bot Dos and VMS will warn you on: >> >> DEL *.* >> >> but not on >> >> DEL Some_File.Txt > > Actually, VMS will warn you about either of those, because the warning > is not about wildcards but about not having specified which version(s) > of the files should be deleted. Adding ;* will avoid the warning. > > In VMS the program calls a standard expansion routine to get each > relevant filespec one at a time, only if wildcard filespecs are the > goal. The command: > > $ SEARCH MY_TEXT.DAT *.* > > looks for the explicit string *.* in the file MY_TEXT.DAT without > any (misguided) attempt to expand wildcards. So will grep '*.*' 'MY_TEXT.DAT' (with the Bourne shell). Understand that: This is no question of "how Unix handles the command line" ore something like this, but simply a question of a specific choice of syntax for "expand this as a wildcard against the file system before passing the arguments" taken by the developers of a specific (though rather standard) shell, the Bourne shell. '*.*' -> don't expand 'abc' -> don't expand abc -> expand *.* -> expand The confusion for people who don't know about the Bourne shell has it's origin in 2 circumstances: (a) The syntax has been chosen in a way that the _absence_ of "quoting" indicates the desire to do wildcard expansion. (b) The expansion of abc is abc (which gives the impression to some people that expansion happens only under certain circumstances (like presence of *) and they complain about the necessity to quote under these circumstances. Wrong: They should quote always :-), if they don't desire expansion, it just happens that the expansion is often the identity. [ There is a catch here, but I won't tell, yet :-) ] Another possible choice would have been, to always quote (to hold strings together, even if the contain spaces and such) and use special syntax to force expansion "abc" -> don't expand "a b" -> don't expand "*.*" -> don't expand glob("abc") -> expand glob("a b") -> expand glob("*.*") -> expand This is what usual programming languages do, and perhaps would have resulted in less confusion, but on the other side its awkward to type. Actually I think it is exactly what scheme shell (scsh) does. Regards -- Markus