why dash (rather than bash)

Archived topics about LMDE 1
Forum rules
LoneStar
Level 1
Level 1
Posts: 27
Joined: Fri May 21, 2010 2:02 pm

why dash (rather than bash)

Postby LoneStar » Wed Mar 02, 2011 7:54 pm

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)?

JasonLG
Level 7
Level 7
Posts: 1620
Joined: Thu May 20, 2010 9:15 pm
Location: Polk City, Iowa USA

Re: why dash (rather than bash)

Postby JasonLG » Thu Mar 03, 2011 2:27 am

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."
"I see" said the blind man to the deaf man who stuck his wooden leg out the window to check the weather.

Gannet
Level 1
Level 1
Posts: 9
Joined: Mon Aug 25, 2014 2:21 pm

Re: why dash (rather than bash)

Postby Gannet » Fri Mar 27, 2015 5:57 am

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: 115
Joined: Mon Jul 14, 2014 1:29 am

Re: why dash (rather than bash)

Postby var » Fri Mar 27, 2015 10:05 am

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


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 14 guests