why dash (rather than bash)

Archived topics about LMDE 1 and LMDE 2
Locked
LoneStar

why dash (rather than bash)

Post by LoneStar »

I guess the title says it all ...
Why oh why is 'sh' a link to 'dash' rather than 'bash'??
I've never ever had a problem with bash - its the default shell for all (as far as I know) linux distros and I _always_ start my scripts with '#!/bin/sh' - not that even that helps, if you do a 'sh myscripts.sh' it will be 'dash', no matter what ...
Admittedly, its not that much of a difference, the most glaring one being "echo -e" in bash which prepends any string with '-e' in dash *sigh*

Can anyone give me a really good reason for using 'dash' (other than it wouldn't otherwise be used)?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
JasonLG

Re: why dash (rather than bash)

Post by JasonLG »

LoneStar wrote:I guess the title says it all ...
Why oh why is 'sh' a link to 'dash' rather than 'bash'??
I've never ever had a problem with bash - its the default shell for all (as far as I know) linux distros and I _always_ start my scripts with '#!/bin/sh' - not that even that helps, if you do a 'sh myscripts.sh' it will be 'dash', no matter what ...
Admittedly, its not that much of a difference, the most glaring one being "echo -e" in bash which prepends any string with '-e' in dash *sigh*

Can anyone give me a really good reason for using 'dash' (other than it wouldn't otherwise be used)?
From the package description of dash in synaptic...

"The Debian Almquist Shell (dash) is a POSIX-compliant shell derived
from ash.

Since it executes scripts faster than bash, and has fewer library
dependencies (making it more robust against software or hardware
failures), it is used as the default system shell on Debian systems."
Gannet

Re: why dash (rather than bash)

Post by Gannet »

It might be worth looking at this - https://wiki.ubuntu.com/DashAsBinSh. I'm a newbie and only discovered about the differences this morning. I'm off to find a wooden leg to stick out of my window!
var
Level 3
Level 3
Posts: 113
Joined: Mon Jul 14, 2014 1:29 am

Re: why dash (rather than bash)

Post by var »

And with the ShellShock bug in Bash, it's actually nice to know that you're not affected.
Locked

Return to “LMDE Archive”