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

Re: Zsh as /bin/sh on Linux?



Tim Pickett wrote:
> > Does anyone have any experience running zsh as /bin/sh on Linux?
> 
> My biggest problem with zsh is that it can often take quite a while to
> start up.  Granted, I have a pretty long .zshenv and even longer .zshrc,

It does not matter in this case.  When zsh is invoked as /bin/sh it will only
source the file in the ENV environment variable which really means that it
usually does not source anything since ENV is undefined.  Sourcing ENV is also
disabled if EUID != UID or EGID != GID.  Also zsh is faster than bash when
executing scripts.

Someone complaind that zsh is too big for /bin/sh.  This does not apply to
Linux since bash has about the same size az zsh (or even bigger).  Also if zsh
is the normal login shell of users it stays in the buffer cache.  Using
bash as /bin/sh means that bash should also stay in the buffers which consumes
more memory.  So in fact you may save some memory using the same shell in
/bin/sh as your login shell.

But really the biggest problem with zsh as sh is incompatibilities in variable
2substitution behaviour.  Probably most of these incompatibilities are bugs in
zsh.  I fixed the most important ones in my releases but I know that there are
still some differences.  Dispite these problems I used zsh as /bin/sh on my
home machine for several months without problems.  Now I use bash again but
only because I bought a new computer and reinstalled Linux on an empty
harddisk and I still did not changed sh to zsh.  Also my old machine had only
4 MB of RAM and it saved me a few Kbytes to use zsh as sh.  Now I have 16MB so
replacing bash with zsh is not so urgent now but I'll probably do that anyway
to catch the bugs.

Cheers,

Zoltan



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