pattern matching in the shell

utzoo!decvax!ucbvax!unix-wizards utzoo!decvax!ucbvax!unix-wizards
Sun Nov 15 17:54:20 AEST 1981


>From gwyn at 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.
-------



More information about the Comp.unix.wizards mailing list