[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ash vs. bash



Carlo Strozzi wrote:
> The difference in execution speed is self-evident. Actually bash can be
> compiled in a minimal, stripped-down version, but even then it is still
> 200 KB in size, and speed-wise it does not improve much. Linking
> /bin/sh to /bin/ash as opposed to /bin/bash would propagate the
> performance advantage to those programs that use the system(3) library
> call, and those that use /bin/sh extensively to interact with the
> undelying OS (/usr/bin/awk is one of those: opening pipes or running
> system() instructions fork /bin/sh). Programs that expect system(3) to
> use a real bourne shell may fail if /bin/sh links to bash. Netscape is
> one of those, as it starts external players with "sh -c ((player %s); rm %s)"
> and the '((' chunk triggers bash's arithmetical expansion code, instead.
> 
> I am pretty sure this must have be touched upon before and I would
> really like to know what where the conclusions.

It has been touched upon before.

The conclusion was that we liked the idea.  As you say, ash is very much
faster.  Also, I was unaware that bash has bourne shell
incompatibilities (in fact, that's a bug - bash, invoked as 'sh' aims to
be a POSIX shell, so you should file a bug against bash).

The main point previously made is that our init sequence would run much
faster with ash, especially on slow machines.

However - there are probably many debian /bin/sh scripts which assume
that 'sh' is in fact bash.  Whilst this is certainly a bug (against
policy even, I think) they can be hard to find.

One thing you could do is make /bin/sh a symlink to ash on an
experimental machine, and then send patches to all packages you have
which break because they have bash-isms.

Jules

-- 
/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd        |
|  Jules aka     |                               |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
+----------------+-------------------------------+---------------------+
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |
\----------------------------------------------------------------------/


Reply to: