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

Re: /bin/sh diversions



On Thu, Aug 02, 2007 at 02:19:41PM +1000, Anthony Towns wrote:
> On Wed, Aug 01, 2007 at 06:00:21PM +0200, Pierre Habouzit wrote:
> > On Wed, Aug 01, 2007 at 12:53:03PM -0300, Henrique de Moraes Holschuh wrote:
> > > OTOH, specifically using something else than /bin/sh for a fast
> > > POSIX-with-the-extensions-Debian-mandates shell (i.e. forget posh, but dash
> > > is good) does NOT need /bin/sh to point to it, so it can't trip on such
> > > issues caused by external factors outside of Debian's control.
> >   Afaict ubuntu did the change, and the sky didn't fell apart.
> 
> It did cause a bunch of problems for Ubuntu users, though:
> 
>     https://bugs.launchpad.net/ubuntu/+source/dash/+bug/61463

  true, but like said, the most usual bashisms could be supported with
trivial patches to dash, when dash is invoked as /bin/sh (to not break
possible scripts using #!/bin/dash).

  the 3 biggest problems I've seen are:

  * [[ for test, trivial: add it as a test alias, and also check for ]]
    termination in the test.c builtin.
  * echo -e: trivial to implement in the printf.c builtin.
  * { } globbing, dash uses the glibc's glob, so it's just a matter of
    adding | GLOB_BRACE to the flags.

  Maybe source (for .) could be added to, I don't expect it to be much
harder. With that, you should be able to run most of the /bin/sh scripts
out there that were written with /bin/sh being bash.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpDNLuieSvIQ.pgp
Description: PGP signature


Reply to: