The man-page of bash, and its behavior is different from what the revision to POSIX and Single Unix Specification says. Below I refer to the specification taht can be accessed at <a href="http://www.UNIX-systems.org/version3/online.html">http://www.UNIX-systems.org/version3/online.html</a>, the locations are relative to <a href="http://www.opengroup.org/onlinepubs/SOME_NUMBER">http://www.opengroup.org/onlinepubs/SOME_NUMBER</a> after you login (free). According to the specification (utilities/sh.html#tag_04_128_04), intercarivity decision should be based on whether stdin and stderr are connected to a terminal, stdout is not important. But /bin/sh\'s decision is based on whether stdin and stdout is connected to a terminal, stderr is not taken into account. --- Running the test from utilities/sh.html#tag_04_128_16 1: $ bash $ echo $- bhimBH $ exit Fine. 2: $ bash > o echo $- $ cat o hB $ bash 2> o bhimBH bash doen\'t conform to POSIX: stdout and sterr roles are swapped. 3: $ /bin/sh > o echo $- $ cat o hB $ /bin/sh 2> o echo $- himB $ cat o sh-2.05a$ sh-2.05a$ exit /bin/sh doesn\'t conform to POSIX, the same reason. 4: $ /bin/sh --posix > o echo $- $ cat o hB $ /bin/sh --posix 2> o echo $- himB $ /bin/sh --posix doen\'t conform to POSIX; the same reason. --- sh-2.05a-alt2
Seems to be fixed in bash-3.0
Fixed in 3.1.1-alt1.