why dash (rather than bash)

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

Important information

why dash (rather than bash)

Postby LoneStar on 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)?
LoneStar
Level 1
Level 1
 
Posts: 27
Joined: Fri May 21, 2010 2:02 pm

Linux Mint is funded by ads and donations.
 

Re: why dash (rather than bash)

Postby JasonLG on 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.
JasonLG
Level 7
Level 7
 
Posts: 1625
Joined: Thu May 20, 2010 9:15 pm
Location: Polk City, Iowa USA

Re: why dash (rather than bash)

Postby Gannet on 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!
Gannet
Level 1
Level 1
 
Posts: 8
Joined: Mon Aug 25, 2014 2:21 pm

Re: why dash (rather than bash)

Postby var on 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.
var
Level 3
Level 3
 
Posts: 114
Joined: Mon Jul 14, 2014 1:29 am


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 4 guests