Bug 1107 - interactivity decision doesn't conform to SUSv3 (SUSv2+POSIX descendant)
Summary: interactivity decision doesn't conform to SUSv3 (SUSv2+POSIX descendant)
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: sh (show other bugs)
Version: unstable
Hardware: all Linux
: P4 minor
Assignee: placeholder@altlinux.org
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-16 14:05 MSD by imz
Modified: 2006-01-06 21:59 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.