Dash. [Was: Re: Exporting $PS1.]

Dan Nicholson dbn.lists at gmail.com
Thu Mar 15 10:20:43 PDT 2007


On 3/15/07, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:
> Dan Nicholson wrote:
>
> > +1. Patch looks good to me. I'm curious to hear about the dropping Ash
> > part of the equation from others, but I think Dash could be added
> > regardless.
>
> I don't have any objections to dropping ash for dash, but I think that
> should be Randy's call.

Right.

> My biggest objection to {,d}ash is that it doesn't use readline.  That
> makes it infeasible (for me) to use interactively.  Additionally, I like
> the extra flexibility of the bash extensions for scripts.

We already had this conversation, but...

I never intend to use dash interactively. If I'm in a shell, I want
the full glory. For a simple script, though, it's more efficient to
use a lightweight shell. I actually measured the difference a while
back, but never got around to posting it:

Time for sysinit using dash
6.633s
Time for 5 using dash
7.763s
Total rc time for dash
14.396s

Time for sysinit using bash
7.455s
Time for 5 using bash
8.154s
Total rc time for bash
15.609s

Percent difference
7.77%

So, using dash cut off nearly 8% on rc. Whether that's significant or
not is up to you. I can attach the diff to /etc/rc.d/init.d/rc if
anyone else wants to measure this on their system.

As for using bash extensions in scripts, I totally agree there. I have
a whole package management system that flexes all of bash's muscles. I
just put #!/bin/bash at the top. /bin/sh is for POSIX scripts.

--
Dan



More information about the blfs-dev mailing list