bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash is interactive despite -c option?


From: David Thompson
Subject: bash is interactive despite -c option?
Date: Thu, 5 Jun 2003 17:38:17 -0700

--The bashbug script's attempt to mail this to bug-bash@gnu.org failed
--so I am resending this to a wider audience.  --David
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2
-march=i386 -mcpu=i686
uname output: Linux proton 2.4.18-27.7.xsmp #1 SMP Fri Mar 14 05:52:30 EST
2003 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05
Patch Level: 8
Release Status: release

Description:
        bash incorrectly thinks it is an interactive shell when
        invoked with the -c option.  The bash man page says,

        --begin--
        INVOCATION
        An interactive shell is  one  started  without  non-option
        arguments  and  without the -c option whose standard input
        and output are both connected to terminals ...

        When an interactive shell that is not  a  login  shell  is
        started,  bash reads and executes commands from ~/.bashrc,
        if that file exists.
        --end--

        This ultimately affects GNU make, which is where I first
        noticed the problem.

Repeat-By:
        Here are the commands I executed,

            $ unset ENV
            $ unset BASH_ENV
            $ echo echo Hello bashrc > ~/.bashrc
            $ /bin/bash -c 'echo $BASH_VERSION'
            Hello bashrc
            2.05.8(1)-release

        The output `Hello bashrc' is incorrect.  I also have bash
        located here,

            $ /usr/local/bin/bash -c 'echo $BASH_VERSION'
            Hello bashrc
            2.05.0(1)-release

        Can you reproduce this bug?

        Note that my login shell *is not* bash.  Here are my
        environment variables, continuation lines inserted
        for readability,

        --begin--
        ATRIAHOME=/usr/atria
        BOPTS_COMMAND_LOGGER=no
        BPATH=/home/davidt/testbin/scripts:/home/davidt/bin
        CCASE_BLD_UMASK=002
        CCASE_CLEARPROMPT_GUI=NO
        CCASE_MAKE_COMPAT=gnu
        DISPLAY=10.10.74.104:0.0
        EDITOR=/home/davidt/bin/linux/vim
        EIO=-n
        FPATH=/home/davidt/ksh/kshfuncs/testing:/home/davidt/ksh/kshfuncs
        GREP_OPTIONS='-d skip'
        HISTFILE=/home/davidt/.hist/proton.10081
        HISTSIZE=2048
        HOME=/home/davidt
        HOSTNAME=proton
        KDEDIR=/usr
        LAMHELPFILE=/etc/lam/lam-helpfile
        LD_LIBRARY_PATH=/usr/local/lib:/usr/X11R6/lib
        LESS='-E -m -Q'
        LESSOPEN='|/usr/bin/lesspipe.sh %s'
        LOGNAME=davidt
        LPDEST=yclept
        LS_COLORS=
        MACHTYPE=linux
        MAIL=/var/spool/mail/davidt
        MANPATH=/home/davidt/man:/usr/man:/usr/share/man:/usr/local/man:\
          /usr/X11R6/man:/usr/atria/doc/man
        PAGER=more
 
PATH=.:/home/davidt/bin:/home/davidt/bin/linux:/home/davidt/bin/tools:\
          /home/davidt/testbin/scripts:/usr/eng/bin:/usr/eng/bin/linux:\
 
/usr/eng/admin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/etc:/usr/etc:\
          /usr/X11R6/bin:/usr/atria/bin:/usr/atria/etc
        PRINTER=yclept
        PVM_ROOT=/usr/share/pvm3
        PVM_RSH=/usr/bin/rsh
        QTDIR=/usr/lib/qt-2.3.1
        REPLYTO='David Thompson <David.Thompson@efi.com>'
        RTCP='-i -q'
        SHELL=/usr/local/bin/ksh
        SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
        SSH_CLIENT='10.10.73.25 54133 22'
        SSH_TTY=/dev/pts/5
        TERM=xterm
        TODO='-prefix Todo:'
        USER=davidt
        X11BIN=/usr/X11R6/bin
        X11LIB=/usr/X11R6/lib
        X11MAN=/usr/X11R6/man
        XPVM_ROOT=/usr/share/pvm3/xpvm
        XWORKSTATION=steiner
        --end--

Fix:
        A workaround for the bash user is to silence commands
        in their ~/.bashrc that produce output.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]