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 of 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.
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
dash or something else. What matters is POSIX compliance — and when you write scripts according to the 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.
It should be mentioned that on some systems, notably Debian, /bin/ash is not available:
$ type ash dash bash: type: ash: not found dash is /bin/dash