[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: question about Dash



On Thu, Aug 06, 2009 at 11:24:18PM -0600, Paul E Condon wrote:
> Recent mentions of dash on this list prompted me to try to learn more
> about it. I googled and learned that it has a different convention for
> indicating that a file is a script that should be processed by
> dash. This affects only the first line of a script.
> 
> Is this the only difference in coding scripts? I know it is said to be
> smaller and faster, which is good, but are there things that need to
> be changed in a bash script, after the first line, in order to make it
> into a proper dash script? What are they? Where can I learn what to
> change in my scripts? Or is it just smaller and faster with no
> conversion pain?
> 
> I'm actually not sure of the change in the first line. That is something
> that I inferred from some puzzling words in an email about getting a
> dash script to work that were made on a Ubuntu list back in 2006.
> 
> I feel uncomfortable being so totally ignorant about an impending change
> in Debian. I want to read something, but can't find anything to read.

from my understanding 

dash is a posix compliant shell
bash isn't - well it has whats called bash-isms

all scripts that work in 
sh should work in dash and bash
dash should work in bash

not all bash scripts will work in sh or dash

the first line is used to invoke a program to process the script for
example

#!/bin/bash

says start /bin/bash to process the script

#!/bin/dash 

etc

#!/usr/bin/awk  for awk
#!/usr/bin/perl  for perl 

etc etc

there is name for this, but I can't remember it right now.

Bashism - off the top of my head, I believe things like $(( - arithmetic
expressions

don't quote me on this - have a google  :)



> 
> 

-- 
The memory management on the PowerPC can be used to frighten small children.
		-- Linus Torvalds

Attachment: signature.asc
Description: Digital signature


Reply to: