Date: Mon, 16 Aug 2021 22:35:12 -0400 From: "Dale R. Worley" <wor...@alum.mit.edu> Message-ID: <875yw4yf1b....@hobgoblin.ariadne.com>
| Back in the old, old days, there was a program named "glob" that did | pathname expansions. That's correct. But: | So you wouldn't say | | cat * | | you'd say | | cat $( glob * ) all of that is utter gibberish. cat * has worked since glob was invented (which is way back even before my time). glob was used by the shell to implement this, and would be run (if I remember correctly) something like /etc/glob cat '*' which would then expand the * (or other pattern, or patterns in the arg list) and exec argv[1] with argv[1]..argv[n] (after expansion) as the arg list. All this allowed a much smaller program than the shell to do the pathname expansion, so it had enough available memory to fit lots of expanded pathnames (at least the couple of hundred that the kernel allowed for arg lists...) - they shell didn't need to include the pattern matching code (just recognition, so it knew when to invoke glob) and glob didn't need any parsing code. There was no concept of PATH, both sh and glob knew to try /bin/cmd and /usr/bin/cmd when cmd contained no '/' chars. kre ps: back when glob existed, there was no form of command substitution available, certainly not $() which is much more recent, but not even the older `` form.