Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Wrong emulation mode if exec'd by su



Martin Aumueller wrote:
>I have a problem with zsh-3.1.4: If I su - to an account the zsh sees
>"su" as executable name -- starting with 's' -- and thus switches to
>Bourne shell emulation mode, not the behaviour desired by me. I have
>solved this problem by testing the full executable names against "sh",
>"csh" and "ksh" with strcmp and now it works as I expect it.

The original behaviour is correct.  "su" really should not give the shell
this weird argv[0] (some versions don't).  But on the older systems where
it does, it's more likely that the shell being invoked is supposed to
be sh, so treating a name of "su" as "sh" is the best behaviour.

To get round this problem, if you can't fix su, put an "exec zsh -l"
in your .profile.  Optionally change your login shell to /bin/sh.

>However, in the patch below I didn't take into account the case
>starting with 'b', don't know what that should be,

"bsh" == Bourne shell.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author