Aucbvax.5186 fa.unix-wizards utzoo!decvax!ucbvax!unix-wizards Sun Nov 15 17:54:20 1981 pattern matching in the shell >From gwyn@UTEXAS-11 Sun Nov 15 17:12:48 1981 If we want to type "finger e*" and have the finger program expand "e*" itself (into a list of user names starting with e), then what do we expect the shell to do with "e*"? Some shells announce "no match" because, in general, a null list of filenames would NOT be what was wanted by the user. Other shells would pass "e*" as an uninterpreted argument to finger, which seems slightly better -- but what if there are files beginning with e present? Then all shells would expand "e*" (assuming you don't maintain a list of exceptional programs). This would totally wreck the use of something like mung [a-z]* *.mac since the mung program clearly expects ONE argument pattern followed by a list of filenames and would have to do filename expansion of "*.mac" on its own from the "raw command line" postulated during recent discussion. Where I work we have several programs that are invoked something like mung "[a-z]*" *.mac and haven't had any user complaints about needing to quote some args. It seems that an unambiguous set of simple rules that permits the user to specify precisely what he means should be a worthwhile goal. I suggest that the existing mechanisms are adequate, if not perfect, and do not need to be changed. Unless something significant turns up, I plan to stop cluttering the unix-wizards mailing list with this topic. ------- ----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen of http://communication.ucsd.edu/A-News/ This Usenet Oldnews Archive article may be copied and distributed freely, provided: 1. There is no money collected for the text(s) of the articles. 2. The following notice remains appended to each copy: The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.