Bug 1093

Summary: interactivity decision doesn\'t conform to doc
Product: Sisyphus Reporter: imz <vanyaz>
Component: bashAssignee: Ivan Zakharyaschev <imz>
Status: CLOSED NOTABUG QA Contact:
Severity: minor    
Priority: P4 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2002-07-14 22:51:05 MSD
The second paragraph in section INVOCATION in bash(1) defines when the shell should be interactive.

According to my tests, the most important part (/bin/bash with stdin and stdout connected to terminals) is not valid for bash.

---
I run a simple executable from an xterm (or linux console):
#!/bin/bash

echo \&quot;$-\&quot;

and get:

$ ./interact.sh           
hB
$ 

After I modify the first line to be \'#!/bin/bash -i\', I get:
$ ./interact.sh 
bhimB
$ 

but, according to the man-page, there should be no difference.

---
bash-0:2.05a-alt2;
this wasn\'t so in bash-0:2.05-alt6.

glibc-2.2.5-alt10 (isatty works correctly)

An issue connected to the wrong decision made by bash on whether it is interactive or not is that bash doesn\'t set $COLUMNS in most scripts. 

Comment 1 Dmitry V. Levin 2002-07-15 18:05:38 MSD
manpage have to be updated.
Comment 2 Dmitry V. Levin 2002-07-15 18:05:38 MSD
manpage have to be updated.
Comment 3 imz 2002-07-16 13:50:48 MSD
Now I see that the old beahvior was not right (didn\'t conform to the man-page), because according to execve(2) a bash-script would be called like this:

/bin/bash scriptname

so /bin/bash has non-option arguments, and thus (according to INVOCATION) the shell should be non-interactive (even if the stdin and stdout are connected to terminals).
Comment 4 imz 2002-07-16 13:50:48 MSD
Now I see that the old beahvior was not right (didn\'t conform to the man-page), because according to execve(2) a bash-script would be called like this:

/bin/bash scriptname

so /bin/bash has non-option arguments, and thus (according to INVOCATION) the shell should be non-interactive (even if the stdin and stdout are connected to terminals).
Comment 5 imz 2002-07-16 13:51:24 MSD
The man-page is correct, the beahvior conforms to the man-page, previous version of bash did it the wrong way. This is not a bug.
Comment 6 imz 2002-07-16 13:51:24 MSD
The man-page is correct, the beahvior conforms to the man-page, previous version of bash did it the wrong way. This is not a bug.