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

Re: Eliminating bash scripts?

On Wed, 28 Sep 2011 13:01:45 +0200
Thomas Hood <jdthood@gmail.com> wrote:

> * The package then has fewer dependencies
> * ... and can then be installed on a system without bash.

Unless the package is doing a lot of clever stuff in shell (at which
point it is possibly worth asking if the package should use a faster
interpreted language like perl - which will be installed even if bash
is not - or converted to a compiled tool), the reasons to
keep #!/bin/bash are likely to be inertia.

> * When /bin/sh is dash, the script will run faster
> * ... and will run on a shell which is smaller and thus less buggy

Not necessarily true.

> * ... and more secure

Not necessarily true.

> * Indeed, dash is the future whereas bash is history.


> Should we be aiming to eliminate all bash scripts from Debian?

I see no good reasons.
> Are there real-world Debian systems that are "minimal" enough
> to have trouble running bash, but not so minimal that busybox
> has to be used?

Such systems would probably involve some form of embedded usage and
most people investigating such things could be expected to at least ask
on the debian-embedded lists or #emdebian on IRC. I don't miss many
queries on either of those and I cannot remember a single instance of
anyone wanting to remove bash but keep dash.

If bash is a problem then perl is a bigger problem and dash is not the
solution. The solution is busybox which means removing coreutils and a
whole world of fettling. i.e. Emdebian Crush.

> One thing I would like to point out immediately is that a bash
> script will not necessarily run faster if it has to be rewritten
> to run on sh.  This is especially true if ${//}s are replaced by
> pipes to sed.

All the more reason to make the rewrite in a different language. If the
tool isn't likely to be needed on minimal systems where the only
available shell is busybox, then a rewrite in perl, python or something
else would seem appropriate. If it could be used with busybox, the only
really sane option is to compile it.


Neil Williams

Attachment: pgpl97tHQG4dn.pgp
Description: PGP signature

Reply to: