bash completion inhibits ability to debug login scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Ubuntu) |
Fix Released
|
Undecided
|
Mika Fischer |
Bug Description
Binary package hint: bash
/etc/bash_
This is a problem if you are trying to run, say, your .profile under "set -vx", for example. This is one of the few facilities we have for debugging log-in scripts. Granted, newbie users will not want to do this, but for those of us who do, this is pretty crippling.
Please see some examples below.
This is for Gutsy; sorry if this is already reported or even (gasp) fixed. I looked through open and closed bash and bash-completion bugs but the search facility isn't very helpful and there are too many bugs to go through manually.
In the following transcript, I am trying to figure out why stuff in my spanking new .bash_profile is not taking. The stuff in /etc/bash_
vnix$ cat .bash_profile
. $HOME/.profile
export LESS=-qMX
vnix$ . .bash_profile
vnix$ echo $LESS
vnix$ # !?
vnix$ set -vx
echo -ne "\033]0;
++ echo -ne '\033]0;era@indeed: ~\007'
vnix$ . .bash_profile
. .bash_profile
+ . .bash_profile
. $HOME/.profile
++ . /home/era/.profile
# ~/.profile: executed by the command interpreter for login shells.
<...>
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_
. /etc/bash_
fi
++++ '[' -f /etc/bash_
++++ . /etc/bash_
# bash_completion - programmable completion functions for bash 3.x
# http://
<...>
#
# RELEASE: 20060301
[ -n "${BASH_
+++++ '[' -n '' ']'
+++++ set +v
++ echo -ne '\033]0;era@indeed: ~\007'
vnix$ # ...?
vnix$ BASH_COMPLETION
+ BASH_COMPLETION
++ echo -ne '\033]0;era@indeed: ~\007'
vnix$ set -vx
set -vx
+ set -vx
echo -ne "\033]0;
++ echo -ne '\033]0;era@indeed: ~\007'
vnix$ . .bash_profile
<...>
# RELEASE: 20060301
[ -n "${BASH_
+++++ '[' -n pretty_please ']'
+++++ set -v
# Alter the following to reflect the location of this file.
#
{
# These declarations must go within braces in order to be able to silence
# readonly variable errors.
BASH_
BASH_
} 2>/dev/null || :
echo -ne "\033]0;
++ echo -ne '\033]0;era@indeed: ~\007'
vnix$ # what now?
Related branches
Changed in bash: | |
assignee: | nobody → zoop |
Here's what the bash manual says about readonly assignments:
> If any of the assignments attempts to assign a value to a
> readonly variable, an error occurs, and the command exits with a non-
> zero status.
So I guess that's the root cause of this problem. I would interpret this to mean that the script simply exits at this point, not merely turns off all debugging output.