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

Re: ash vs. bash

On Sun, Jul 25, 1999 at 12:12:42PM -0700, Joey Hess wrote:
 >Raul Miller wrote:
 >> Or, if you prefer to not have to explicitly use the "system"
 >> command every time you run an external program, use CPAN
 >> to install the Shell module...
 >Shell.pm can't handle commands like "./a.out" or "/sbin/foo" or even
 >"some-long-command-with-dashes". I also like shell-style pipes and

I take this message as an opportunity to try and bring the discussion back
to the original point: /bin/sh -> /bin/bash vs. /bin/sh -> /bin/ash.

I have now been using the latter link on a couple of production systems
with no major problems. The most common incompatible constructs that
I have met in scripts that begin with '#!/bin/sh' were:

1. The tilde-expansion for home directories, i.e. ~user/...
2. The stdout+stderr redirection &>
3. Name expansions in the form {a,b,c}

The problem is that some of the pre/post scripts in /var/lib/dpkg/info/
use bash estensions without correctly beginning with '#!/bin/bash', thus
"violating" Debian's recommendations. The same goes for some of the scripts
in /etc/init.d/ (one is /etc/init.d/squid, that uses a bash-specific command).
This means that whenever I will run dselect or apt-get to carry out a major
system upgrade I will have to rememember to restore the original link,
to prevent pre/post script failures.

Fortunaltely I met no scripts that used other more esoteric bash features,
like arrays, and that, as more sophisticated programming needs usually
involve perl, awk, and so on.

I truly believe that using ash as the basic bourne shell would be a step
forward toward a more 'compliant' and certainly a faster system, another
little thing that would positively distinguish Debian from all other 
distributions. It would also be an opportunity to enforce, once and for
all, the policy that bash scripts should begin with '#!/bin/bash', to
prevent bourne incompatibilities in scripts.

I do realize that there are more urgent topics to be discussed now
that potato is about to be released, with open questions about the
2.2.x kernel and so on, but I really hope that this discussion will
not fade away without producing either a 'yes' or a 'no' answer.

Carlo Strozzi
Key fingerprint = CF22 C843 2D81 11D2 DE54  CD02 8FA4 9A94 2483 9893

Against software patents:
http://www.freepatents.org - http://no-patents.prosa.it

Reply to: