|
|
|
|
|
by chubot
29 days ago
|
|
OK interesting, yeah I think dash is just plain broken ... $ dash -c 'echo "c:\\new"'
c:
ew
$ busybox ash -c 'echo "c:\\new"'
c:\new
It requires 4 backslashes: $ dash -c 'echo "c:\\\\new"'
c:\new
$ busybox ash -c 'echo "c:\\\\new"'
c:\\new
I am not sure this is a matter of "undefined behavior in POSIX" -- I think it might just be dash being wildly unconformant, which I have seen in other cases.It's one of the least POSIX compliant shells. It is derived from the same codebase as busybox ash, but busybox receives more maintenance. --- In any case, it is pretty sad that sh is in such poor shape than the default /bin/sh on Debian has different behavior in this basic case. I built OSH to be a set of semantics agreed upon by many shells. I don't think any cross-shell test suites like our spec tests had existed in the past - https://oils.pub/release/0.37.0/quality.html But there is little coordination among shell authors, and no real motivation to fix the gaps. In contrast, there is A LOT of coordination among JavaScript engine authors, mostly because there are people paid to work on them. |
|
Interestingly, that doesn't allow implementation-defined behavior for "echo -e", for which bash does have special behavior.