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

Re: Eliminating bash scripts?

On Wed, 28 Sep 2011 at 13:01:45 +0200, Thomas Hood wrote:
> * The package then has fewer dependencies
> * ... and can then be installed on a system without bash.

This doesn't help Debian directly, but it may help upstreams to be portable
to operating systems with a reason to use a non-bash shell - embedded systems
with Busybox, BSDs with ideological objections to the GPL, proprietary Unixes
with a grudgingly-POSIX-compliant proprietary shell.

> * If sed has to be used, that OK, its regexps are better than
> bash's extended globs.

If you can use ${x%%y}, ${x#y} etc. to achieve the same effect (you often can),
you get the best of both worlds. I believe they're specified by POSIX;
certainly, current dash supports them, and they're in the SUS.

Otherwise, it's a trade-off. Basic use of sed + sh should work on most
Busybox-based embedded systems and on any POSIX-compliant Unix, whereas
bash is a non-standard addition - but on the other hand, bash extended
globs save a fork().

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

IMO: if there are bash scripts that can be converted into POSIX sh scripts
easily, why not? but if it would make the script significantly less
maintainable, your time is usually more valuable than your CPU's.


Reply to: