Wikipedia says that dash
executes faster than bash
. My question is, if I set /bin/sh
to dash
, will all scripts that use /bin/sh
in their shebang line that was intended for bash
work under dash
?
Take the 2-minute tour
×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.
|
||||
No, not all scripts intended for bash work with dash. A number of 'bashism' will not work in dash, such as C-style for loops and the double-bracket comparison operators. If you have a set of bash scripts that you want to use for dash, you may consider using checkbashisms. This tool will check your script for bash-only features that aren't likely to work in dash. |
|||||||||||||||||||||
|
Not even sh scripts are compatible with dash. Pkgsrc's bootstrap, par example. |
|||||||||||||
|
#!/bin/bash
and that his scripts aren't posix compliant and thus need to be specified to run with the proper interpreter – xenoterracide♦ Sep 5 '10 at 3:00