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 Path: g2news2.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada.Command_Line and wildcards Date: Thu, 22 Feb 2007 20:15:31 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <45dcaed8_6@news.bluewin.ch> <1172132169.423514.271890@s48g2000cws.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1172193331 4519 192.74.137.71 (23 Feb 2007 01:15:31 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 23 Feb 2007 01:15:31 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:mzwx7m1NknUrxPcrsMEX2CMCsbc= Xref: g2news2.google.com comp.lang.ada:9434 Date: 2007-02-22T20:15:31-05:00 List-Id: Jean-Pierre Rosen writes: > Too bad that Unix behaviour was wrong in the first place... I agree with JP Rosen, here. The way wildcards work in Unix is completely broken. (Not that I'm advocating Windows instead!) I type: grep -i blah *.ad? and I get: Arguments too long. Yuck -- bad design! And there's no wildcard that means "all subdirectories, recursively". So we're stuck with kludgery like "find" and "xargs". Yuck. If I meant to type: mv some_dir/*.ada . But I forgot the ".", so I accidentally typed: mv some_dir/*.ada I get an error message (OK). Except in the case where there happen to be exactly two files ending in .ada in that directory -- then the command destroys one of them! Yuck. And I can't create a command that works like this: search *.ada "some string" That's why the arguments of "grep" are backwards (search-string first, then the file names -- I've gotten so used to it that I hardly remember that it is indeed backwards). Yuck. If I type: rm *.junk blah.* and there happens to be a file called blah.junk, I get an annoying error message. Why? I asked to delete that file! The problem is not so much that the shell does the wildcard expansions. The problem is that it's all based on textual substition. Semantics based on textual substition is just plain confusing. What looks like one argument (e.g. *.ada) ought to be in fact one argument (albeit a list of many files). - Bob