Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!axion!tsa!domo From: domo@tsa.co.uk (Dominic Dunlop) Newsgroups: comp.lang.c Subject: Re: wildcard matching Message-ID: <1991Jan4.095351.12412@tsa.co.uk> Date: 4 Jan 91 09:53:51 GMT References: <4739.277BA2FB@urchin.fidonet.org> <579@cadlab.sublink.ORG> Reply-To: domo@tsa.co.uk (Dominic Dunlop) Organization: The Standard Answer Ltd. Lines: 26 In article <579@cadlab.sublink.ORG> staff@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