I wanted to know whether scripts written for dash, ash, and sh are 100% compatible?
Are there any added features to dash or ash, or syntax change?
From what I heard, ash is a direct descendant of sh.
|
I wanted to know whether scripts written for dash, ash, and sh are 100% compatible? Are there any added features to dash or ash, or syntax change? From what I heard, ash is a direct descendant of sh. |
||||
|
The short answer is no, they're not 100% compatible. But most the shells are pretty close to the basic, so you would only rarely bump into inconsistencies. In fact, most shells differ not much by added syntax, but by some extra features like tab-completion and similar. Also, dash is sort of a descendant of ash - or port from BSD to linux, to be precise. And all of them should be descendants or different implementations of sh. In fact, sh is on most systems just a symlink to bash, dash or something else. What matters is POSIX compliance - and when you write scripts according to standards, you won't run into problems. The difference between those shells is in optimizations and performance. They're less feature-rich then bash, but they are fully legitimate shells. Bash is feature-rich for interactive work, but uses more memory, for example. |
|||||||||||
|
man ash– warl0ck Aug 7 '12 at 6:36checkbashismsto test that your script is POSIX compliant. – donothingsuccessfully Aug 7 '12 at 17:37