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

Re: Want to replace bash w zsh as system shell on Ubuntu



On Tuesday 02 February 2010 11:11:40 Richard Hartmann wrote:
> I tried to use zsh as the system shell on Debian unstable a year or so ago.
> 
> After lots of things breaking, I gave up.

It should be easier on ubuntu because they switched their default system shell 
from bash to dash and had to change some init scripts to posix sh compliant 
syntax.

Second they use upstart scripts to replace some common sysv init scripts. 
These upstart scripts were rewritten from scratch and are posix sh compliant 
too.

> The general consensus on the mailing list is that it is a bad idea to use
> it as /bin/sh -- search the archives for details.
> The main reason is probably that zsh predates most standards and thus
> still has a few quirks and edges that are not worth ironing out as no one
> uses zsh as /bin/sh, anyway. Hen and egg, I guess.

Zsh runs in sh compatibility mode if it's executable was called via symlink 
from /bin/sh. But the problem is most distribution's init scripts are only 
bash compliant but are called via symlink from /bin/sh.

Sh compliant shell scripting can't use stuff like associative arrays, 
subshell commands like "echo $(date -R)" or "[["-style tests. But some init 
scripts do.

> Also, please note that you need to link to /bin/zsh not /usr/bin/zsh or
> you _might_ break stuff (admittedly unlikely on today's single-user
> systems).

Dynamic linking problems (libpcre) have been fixed in recent ubuntu zsh 
releases. Probable the same in debian (unstable) releases. It's save to link 
to /bin/zsh.

 
> I would just
> 
>   chsh
> 
> as root and be done with it.

There's a difference between running "sudo -s" and changing the shell via 
"chsh" and using "su". Sudo doesn't change the HOME environmental variable to 
HOME=/root. It's set to "HOME=$HOME" so the root session uses the 
configuration files of the user. That's why you don't have to copy your 
~/.vimrc configuration to /root/.vimrc.

This behavior is very important if you're running a system with multiple 
admins.

Attachment: signature.asc
Description: This is a digitally signed message part.



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