dash as /bin/sh breaks POSIX 1003.1 scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: dash
On feisty, dash is installed with a symlink to /bin/sh. This breaks POSIX 1003.1 compliant scripts as
demonstrated below:
mez@jaguar{~}$ dash
$ x=3
$ echo $(( x + 4 ))
dash: arith: syntax error: " x + 4 "
$ echo $(( $x + 4 ))
7
As stated in the online version of 1003.1 (http://
If the shell variable x contains a value that forms a valid integer constant, then the arithmetic
expansions "$((x))" and "$(($x))" shall return the same value.
dash clearly violates the standard here.
I have read all of the "bash vs dash" flame wars. This isnot about bash doing the right thing, but
about dash doing the wrong thing. This breaks, amongother things, the canonical use of
"while getopts ..." followed by "shift $((OPTIND - 1))" as recommended by many books stressing
POSIX scripting.