shell globbing

utzoo!decvax!ucbvax!unix-wizards utzoo!decvax!ucbvax!unix-wizards
Sun Nov 15 23:09:12 AEST 1981


>From cbosgd!mark at Berkeley Sun Nov 15 22:13:34 1981
I do understand both sides of this issue and am sitting on the fence.
However, two people have claimed that "the shell" will abort if there
are metacharacters which don't match.  Actually, this isn't very true.
The Bourne shell will, if there is no match, just pass the arguments
through (try "echo *foo*" for example).  Csh will default to aborting,
but if you set nonomatch in your .cshrc, will behave like sh.  Not that
this is a useful solution to the problem, since it's unwise to write a
program that (a) depends on the user setting nonomatch, and (b) depends
on there not being any matching files.  In particular, the best reason
to put something like this in would be a pip style command:
	mv *.c *.c.old
and in such cases, half of the globs WOULD match.

One way to implement it that nobody has mentioned would be to put the
full command line in COMMAND in the environment.  I don't know if the
overhead from this would be unreasonable.  And of course, it wouldn't
work on V6, but V6 is nearly dead for most of us .



More information about the Comp.unix.wizards mailing list