wildcard matching

Dominic Dunlop domo at tsa.co.uk
Fri Jan 4 20:53:51 AEST 1991


In article <579 at cadlab.sublink.ORG> staff at cadlab.sublink.ORG (Alex Martelli)
writes:
> I know that MSDOS and OS/2 consider that, when typing "a*b" or "a*c",
> the user was just being funny, and he _actually_ meant just "a*" in
> either case... presumably the extra letter, or letters, having been
> typed just to keep his or her fingers in exercise?-)
> 
> I'm also happy to relate, though, that _other_ operating systems DO
> have a modicum of common sense in their wildcars semantics!
> That is, one can use, for example, "a*b" to stand for all files with
> names beginning with a and ending with b, with anything or nothing in
> between.  This is true at least in Dec's VMS and IBM's VM/SP (CMS), as
> well, of course, as in Unix.

For what it's worth (all contributions gratefully received), the
forthcoming POSIX 1003.2 shell and tools standard codifies UNIX-style
filename ``globbing'', including the System V-ish ``*[!c]'' to match, in
this example, any filename not ending in ``c''.  The standard will
specify two functions, glob() and globfree() which can be called from
the C language, ending today's unsatisfactory situation, where one must
either recode globbing or spawn a shell to do it.

How much all this helps users of other operating systems is open to
question...
-- 
Dominic Dunlop



More information about the Comp.lang.c mailing list