[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash is interactive despite -c option?
From: |
cpr |
Subject: |
Re: bash is interactive despite -c option? |
Date: |
Fri, 06 Jun 2003 13:10:17 -0400 |
> 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,
[...]
> 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
I cannot reproduce this with bash-2.05 or 2.05[ab].
However, bash-2.05 (by default) and bash-2.05[ab] (if compiled with
SSH_SOURCE_BASHRC defined in config-top.h) will read and execute
commands from ~/.bashrc if the shell thinks it's a top-level shell
being executed by sshd.
Apparently the conditions under which you're running gnu make are
convincing bash that it's being run by sshd.
It's this issue which persuaded me to turn the check off by default
in bash-2.05a.
Chet Ramey