On Sun, Jul 9, 2017, at 08:26, Doug McIlroy wrote:
It is also interesting to speculate on whether there
would
be a glob library routine in Linux had glob only been an identifier in
sh.c rather than an entry in /bin.
I'm not sure - wordexp exists, and that was never a separate program.
Both first appeared in POSIX.2, as far as I can tell. They appear in
4.4BSD but not any earlier version of BSD, and not that I can find in
System V. The implementation in OpenSolaris is not SysV-derived. This
suggests to me that they were invented by the committee.
The first appearance of "fnmatch" in the Google archive of Usenet is a
1986 post about a library routine for Amiga (accompanied by a vaguely
glob-like "wildexp", and also DOS-style "findfirst/findnext") . The
first Unix-related appearance was a 1990 article about the progress of
the POSIX.2 standard itself.
I suppose it's possible that without the memory of a "glob" utility, a
findfirst/findnext-style routine might have been implemented instead (or
just findnext - findfirst would be equivalent to opendir+findnext).