zsh-users
 help / color / mirror / code / Atom feed
* Zsh as /bin/sh on Linux?
@ 1996-01-18 19:24 Steven L Baur
  1996-01-18 20:18 ` Christopher White
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Steven L Baur @ 1996-01-18 19:24 UTC (permalink / raw)
  To: zsh-users

Does anyone have any experience running zsh as /bin/sh on Linux?
Alternatively, how about using /bin/zsh as the root login shell?

Regards,
-- 
steve@miranova.com baur


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 19:24 Zsh as /bin/sh on Linux? Steven L Baur
@ 1996-01-18 20:18 ` Christopher White
  1996-01-18 20:38   ` Jari Kokko
  1996-01-18 20:41   ` Hrvoje Niksic
  1996-01-18 21:22 ` Jeff "Obik" Epler
  1996-01-19  2:51 ` Tim Pickett
  2 siblings, 2 replies; 9+ messages in thread
From: Christopher White @ 1996-01-18 20:18 UTC (permalink / raw)
  To: zsh-users

> 
> Does anyone have any experience running zsh as /bin/sh on Linux?
> Alternatively, how about using /bin/zsh as the root login shell?
> 
> Regards,
> -- 
> steve@miranova.com baur
> 
> 

I use zsh as the root login on both Linux, SunOS, and Solaris.  I haven't run
into any problems that I can trace directly to zsh.  Sun once complained that
what I was doing was "non-standard," but since we've seen no side-effects, no
one seemed to care.

I don't use zsh as sh at all.  I figure that if a shell script has #!/bin/sh
in it, I should give it what it wants.  Of course, none of *my* scripts use
sh...!

Hope this helps!

-- 
Christopher T. White
Leader, UNIX System Administration Team
CD-ROM/Online Development Group
CCH Incorporated
whitech@qu_srd_f1.cch.com
WWW: http://www.cch.com/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 20:18 ` Christopher White
@ 1996-01-18 20:38   ` Jari Kokko
  1996-01-18 20:41   ` Hrvoje Niksic
  1 sibling, 0 replies; 9+ messages in thread
From: Jari Kokko @ 1996-01-18 20:38 UTC (permalink / raw)
  To: zsh-users

Quoted from Christopher White's message dated January 18:
>I use zsh as the root login on both Linux, SunOS, and Solaris.  I haven't run
>into any problems that I can trace directly to zsh.  Sun once complained that
>what I was doing was "non-standard," but since we've seen no side-effects, no
>one seemed to care.

I have zsh as root's login shell on SunOS, but I've linked a static
binary for that and placed it in /sbin, just in case the shared libs go
screwy on me.

zsh as sh seems a bit big... 

pilvi ~ $ uname -a; ll =sh =zsh /sbin/zsh
SunOS pilvi 4.1.1 14 sun3
-rwxr-xr-x  1 root     staff      401408 Dec 15 15:24 /sbin/zsh*
-rwxr-xr-x  1 root     staff       73728 Dec  5 22:53 /usr/bin/sh*
-rwxr-xr-x  2 jari     wheel      327680 Dec 31 18:03 /usr/local/bin/zsh*

Jari Kokko


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 20:18 ` Christopher White
  1996-01-18 20:38   ` Jari Kokko
@ 1996-01-18 20:41   ` Hrvoje Niksic
  1 sibling, 0 replies; 9+ messages in thread
From: Hrvoje Niksic @ 1996-01-18 20:41 UTC (permalink / raw)
  To: Christopher White; +Cc: zsh-users

In your mail, you said:
> I don't use zsh as sh at all.  I figure that if a shell script has #!/bin/sh
> in it, I should give it what it wants.  Of course, none of *my* scripts use
> sh...!

The problem with zsh as a substitute for /bin/sh are minor incompatibilities
with sh, which (although they can even be features) can force scripts to
fail. Examples could be shwordsplit (although it might be turned on when zsh
is invoked as sh, I don't know), or subshells and pipelines (e.g. in while
constructs).

Sh has many dark sides which are often heavily used, thus it is better to
leave the original sh's, or (in Linux's case) bash, which is specialized for
imitating sh's glitches.

-- 
hniksic@srce.hr              |  Student of electrical engineering
http://www.srce.hr/~hniksic/ |  University of Zagreb, Croatia
------------------------------------------------------------------
He didn't administer the reign of terror, just the occasional light shower.
        -- (Terry Pratchett, Sourcery)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 19:24 Zsh as /bin/sh on Linux? Steven L Baur
  1996-01-18 20:18 ` Christopher White
@ 1996-01-18 21:22 ` Jeff "Obik" Epler
  1996-01-18 21:45   ` Steven L Baur
  1996-01-19 11:32   ` Zoltan Hidvegi
  1996-01-19  2:51 ` Tim Pickett
  2 siblings, 2 replies; 9+ messages in thread
From: Jeff "Obik" Epler @ 1996-01-18 21:22 UTC (permalink / raw)
  To: Steven L Baur; +Cc: zsh-users

A bigger problem (IMO) than worrying about odd sh compatibilities when
using (trying to use) zsh as /bin/sh under Linux, is all the
dependancies on Bash featurisms, since bash is the /bin/sh on most
Linux systems.

No, I don't know any particulars -- I've just heard the folks on IRC
bitch from time to time that this-and-such package (written on Linux)
says #!/bin/sh and needs bash.

OTOH, I've been using zsh (dynamically linked, but in /sbin) as root's
shell for quite some time.  Since the /bin/sh that account had
formerly was also dynamically linked, I don't feel like I lost any
safety net...

Jeff
-- 
\/ Jeff Epler jepler@{inetnebr.com|cse.unl.edu|herbie.unl.edu|nyx.cs.du.edu}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 21:22 ` Jeff "Obik" Epler
@ 1996-01-18 21:45   ` Steven L Baur
  1996-01-19 11:32   ` Zoltan Hidvegi
  1 sibling, 0 replies; 9+ messages in thread
From: Steven L Baur @ 1996-01-18 21:45 UTC (permalink / raw)
  To: zsh-users

>>>>> "Jeff" == Jeff "Obik" Epler <jepler@herbie.unl.edu> writes:

Jeff> A bigger problem (IMO) than worrying about odd sh compatibilities when
Jeff> using (trying to use) zsh as /bin/sh under Linux, is all the
Jeff> dependancies on Bash featurisms, since bash is the /bin/sh on most
Jeff> Linux systems.

Jeff> No, I don't know any particulars -- I've just heard the folks on IRC
Jeff> bitch from time to time that this-and-such package (written on Linux)
Jeff> says #!/bin/sh and needs bash.

Jeff> OTOH, I've been using zsh (dynamically linked, but in /sbin) as root's
Jeff> shell for quite some time.  Since the /bin/sh that account had
Jeff> formerly was also dynamically linked, I don't feel like I lost any
Jeff> safety net...

Thanks for all the responses.  I'd love to run a vanilla, small, real
sh as /bin/sh, but that does not appear to be an option.  Replacing
bash with zsh as a root login sounds feasible, although I'm going to
replace beta13 with the beta13-hzoli12 version before I attempt that
switch.

Regards,
-- 
steve@miranova.com baur


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 19:24 Zsh as /bin/sh on Linux? Steven L Baur
  1996-01-18 20:18 ` Christopher White
  1996-01-18 21:22 ` Jeff "Obik" Epler
@ 1996-01-19  2:51 ` Tim Pickett
  1996-01-19 11:08   ` Zoltan Hidvegi
  2 siblings, 1 reply; 9+ messages in thread
From: Tim Pickett @ 1996-01-19  2:51 UTC (permalink / raw)
  To: zsh-users

> 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,
but waiting those extra seconds can add up, especially if a shell script
has lots of subprocesses, each of which requires a new shell.
Of course, the default under Linux, bash, is not much smaller, so unless
you want to go and get a real /bin/sh replacement it probably doesn't
matter much.

The main concern, if you want to go writing shell scripts for others to
use, is to not use any of zsh's extra features, because they will break
spectacularly on computers that don't have zsh.  In which case - why
bother using zsh at all?

> Alternatively, how about using /bin/zsh as the root login shell?

Personally I keep root using bash, mainly because bash is relatively
incomvenient compared to zsh, so I'm not tempted to do anything complex
as root . . .

-- 
Tim Pickett                                     tlm@yoyo.cc.monash.edu.au
"You gotta bat your eyes - like this."         tbp@molly.cs.monash.edu.au


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-19  2:51 ` Tim Pickett
@ 1996-01-19 11:08   ` Zoltan Hidvegi
  0 siblings, 0 replies; 9+ messages in thread
From: Zoltan Hidvegi @ 1996-01-19 11:08 UTC (permalink / raw)
  To: tlm; +Cc: zsh-users

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Zsh as /bin/sh on Linux?
  1996-01-18 21:22 ` Jeff "Obik" Epler
  1996-01-18 21:45   ` Steven L Baur
@ 1996-01-19 11:32   ` Zoltan Hidvegi
  1 sibling, 0 replies; 9+ messages in thread
From: Zoltan Hidvegi @ 1996-01-19 11:32 UTC (permalink / raw)
  To: Jeff "Obik" Epler; +Cc: zsh-users

> A bigger problem (IMO) than worrying about odd sh compatibilities when
> using (trying to use) zsh as /bin/sh under Linux, is all the
> dependancies on Bash featurisms, since bash is the /bin/sh on most
> Linux systems.

Zsh know the extra features that sh scripts under Linux tends to use.  I thing
these are mostly the ${...%...} type substitutions.  I think that this
substitution syntax is part of the POSIX shell specification.  If one wants to
use a lightweight replacement for bash she may also try pdksh which tries to
be posix conformant and know almost everything that bash knows and it is even
faster than that.

Cheers,

Zoltan


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1996-01-19 11:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-01-18 19:24 Zsh as /bin/sh on Linux? Steven L Baur
1996-01-18 20:18 ` Christopher White
1996-01-18 20:38   ` Jari Kokko
1996-01-18 20:41   ` Hrvoje Niksic
1996-01-18 21:22 ` Jeff "Obik" Epler
1996-01-18 21:45   ` Steven L Baur
1996-01-19 11:32   ` Zoltan Hidvegi
1996-01-19  2:51 ` Tim Pickett
1996-01-19 11:08   ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).