Date: Sat, 1 Jun 2019 19:51:18 -0500
From: Steven Penny <[email protected]>
Message-ID:
<CAAXzdLVV9pWd6v3OG1byfb=DL40=fq0tbryvwnqc7ptxm5p...@mail.gmail.com>
| This would work:
|
| grep -- pattern /dev/null
|
| Same result with "ls":
|
| for hh in glob.glob('*'):
| print(hh)
|
| With a failed glob, output shouldnt be "the current directory".
| Output should be *nothing*.
In order to make those work, both of them, either the glob needs to
be expanded by the command, rather than the shell (which flies in the
face of one of the important mandates of unix from the very start, that
the processing be the same for all commands) or the shell has to be
taught the required procedures for every command (including of course
the ones which would prefer to have no glob done at all.)
Neither of those is rational, nor is what happens if a non-matching
glob returns nothing.
And for commands that don't really want glob at all (even given that
their args probably should be quoted) nor is generation an error when
a glob fails to match.
There were (and are) reasons for the decisions made when the Bourne shell
was designed - sure some of them are compromises, but the explicit
decisions that were made were not made in a vacuum - don't you think that
even if you believe that srb was an idiot who had no idea what he was
doing, that one of the others at Bell Labs might not have suggested
alterations if they thought there were better alteratives.
So, everyone, please go design your ideal shell someplace else - this is
not the venue for it. Or better still, implement it and get it adopted
by the world, and then come back.
kre