<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>1093</bug_id>
          
          <creation_ts>2002-07-14 22:51:05 +0400</creation_ts>
          <short_desc>interactivity decision doesn\&apos;t conform to doc</short_desc>
          <delta_ts>2003-08-25 15:18:32 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>bash</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="imz">vanyaz</reporter>
          <assigned_to name="Ivan Zakharyaschev">imz</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1042</commentid>
    <comment_count>0</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-14 22:51:05 +0400</bug_when>
    <thetext>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 \&amp;quot;$-\&amp;quot;

and get:

$ ./interact.sh           
hB
$ 

After I modify the first line to be \&apos;#!/bin/bash -i\&apos;, I get:
$ ./interact.sh 
bhimB
$ 

but, according to the man-page, there should be no difference.

---
bash-0:2.05a-alt2;
this wasn\&apos;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\&apos;t set $COLUMNS in most scripts. 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3876</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-07-15 18:05:38 +0400</bug_when>
    <thetext>manpage have to be updated.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7241</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2002-07-15 18:05:38 +0400</bug_when>
    <thetext>manpage have to be updated.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3877</commentid>
    <comment_count>3</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-16 13:50:48 +0400</bug_when>
    <thetext>Now I see that the old beahvior was not right (didn\&apos;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).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7242</commentid>
    <comment_count>4</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-16 13:50:48 +0400</bug_when>
    <thetext>Now I see that the old beahvior was not right (didn\&apos;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).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3878</commentid>
    <comment_count>5</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-16 13:51:24 +0400</bug_when>
    <thetext>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.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7243</commentid>
    <comment_count>6</comment_count>
    <who name="imz">vanyaz</who>
    <bug_when>2002-07-16 13:51:24 +0400</bug_when>
    <thetext>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.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>