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}"

The problem is the ~(Elr)(alias|unalias|command) pattern.
~(modifer)pattern is an extended pattern syntax which allows to specify
a "modifer" to change the behaviour for "pattern" ([1]). In this case
the "Elr" selects "extended regular expression mode with left and right
anchors" and "(alias|unalias|command)" is then the matching egrep
pattern. However the '~' at the beginning of this string is causing a
tilde expansion (or better: It's filling an internal buffer as
preparation for tilde expansion) which shouldn't be done in this case.

[1]=For example the "modifer" allows to specifcy "perl", "fgrep",
"grep", "egrep", "POSIX shell", "korn shell" and other types of pattern
matching systems (or select stuff like archors, case-insensitive
matching etc. etc.).

> fi
> 
> Clearly this needs to be fixed.
> 
> Also, it looks at my whole $PATH; it shouldn't do that.  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".

Right...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to