D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Problem with Bash script on Ubuntu

 

Neil Williams wrote:
> 
> Umm, Debian is also dropping bash as the default shell.

That doesn't make it any smarter.

Kind of the nature of ideas that they are smart or stupid, independent
of how many people accept them.

The "goal" seems to be to make dash install as /bin/sh, I didn't see a
reference to Debian changing its default shell, rather that "dash"
should work for those that prefer it and ask for it to be installed as
the default shell.

> bash is just too slow, especially at boot time.

I don't buy that.

Bash is known to be slow and bloated, on the other hand in the last 5 or
years I've been using Debian CPUs have gotten about 8 times faster, so
there is a new requirement that shell scripts be a few percentage points
faster because the 8 fold speed up wasn't enough?

If speed was the issue one would get a far bigger speed up moving the
lsb init-function declarations into the parent shell, rather than
sourcing them in about half the start-up scripts. 69 startup scripts
(out of 104) source this set of functions on my box to define the same
set of functions, so that is 68 script invocations that can go
immediately. PHP's "include once" seems so clever in comparison ;)

The question isn't whether dash is better, faster, or anything else, it
is about backward compatibility.

It is especially daft in Debian derivatives before Debian has made the
switch - but it looks like pointless drift in Debian to me. Indeed if
some bashisms are fixed by #!/bin/bash, then small systems will need
both Bash and Dash installed, and we'll have increased the footprint and
memory demands (and probably slow booting).

One reference suggested dash was proposed because it had a smaller
footprint and thus more robust, but the root shell on many old Unix
systems was statically linked (hence /sbin/sh), precisely to avoid
dependencies on a wide bit of the file system that might not be mounted,
or might be damaged. One could do that with bash (making it more bloated
and slower) if that was the real reason.

So it looks like a couple of developers prefer dash and have been
working through 200 odd bashisms in Debian for a goal that probably
won't noticeably advance Debian. Their time I guess, although no doubt a
lot of the work was done by other DDs.

Don't get me wrong I like standards, and I think it nice that Debian is
moving to posix compliance for so many scripts. But the first bug report
I opened, also mentioned that upstream code in the package (not just the
Debian glue and install scripts) broke because it had a bashism in it.

There is a special place in Usenet Unix folk law for people stupid
enough to change the default shell of root on their Unix systems, let us
hope we don't have to place the entire Debian project in that category.




Attachment: signature.asc
Description: OpenPGP digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html