Bug 1107

Summary: interactivity decision doesn't conform to SUSv3 (SUSv2+POSIX descendant)
Product: Sisyphus Reporter: imz <vanyaz>
Component: shAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P4 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2002-07-16 14:05:15 MSD
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 &gt; o
echo $-
$ cat o
hB
$ bash 2&gt; o
bhimBH

bash doen\'t conform to POSIX: stdout and sterr roles are swapped.

3: 

$ /bin/sh &gt; o
echo $-
$ cat o
hB
$ /bin/sh 2&gt; 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 &gt; o
echo $-
$ cat o
hB
$ /bin/sh --posix 2&gt; o
echo $-
himB
$ 

/bin/sh --posix doen\'t conform to POSIX; the same reason.

---
sh-2.05a-alt2
Comment 1 Dmitry V. Levin 2006-01-03 02:58:58 MSK
Seems to be fixed in bash-3.0
Comment 2 Dmitry V. Levin 2006-01-06 21:59:02 MSK
Fixed in 3.1.1-alt1.