Casper.Dik at Sun.COM wrote: > So what exactly does this do: > > if [[ "${cmd}" != ~(Elr)(alias|unalias|command) ]] && ! alias "${cmd}" > >/dev/null 2>&1 ; then > builtin "${cmd}" > fi > > > Clearly this needs to be fixed.
Ok, since I've read enough of this to know, I'll answer: that tests whether the command was invoked with the exact name 'alias', 'unalias', or 'command', or if the command is aliased; if not, it executes the 'builtin' command on it. I also see grammatical errors in the comment 'explaining' what the above line does, which could be fixed to make that some clearer. The fact that ~(Elr), a modifier to the pattern-match, does a homedir expansion is apparently the bug here. That causes the erroneous nameservice lookup. > Also, it looks at my whole $PATH; it shouldn't do that. Not sure why that's happening; probably because of "command" below. It seems to me that "command" should have -p there; not sure why it doesn't. > And since there's > a plan to make more executables ksh93 built-in, we need to make sure that > doesn't happen until we have fixed all bugs in "sleep". As Roland noted, it gets even more complex, because sleep is now a binary so that pgrep sleep works. making one wonder again at the point of this. I guess the argument is that the paradigm shifts to "userland is a set of programs" to "userland is at least half a shell that does everything simple more or less on its own".