This Ubuntu machine is showing errors when I start a new terminal. The problem is this:
When bash completion is sourced (
. /usr/share/bash-completion/bash_completion) the shell taking place is not
bash and some variable definitions with lists
local words=() is failing (because only
bash understands lists).
My solution was to explicitly call with
bash /usr/share/bash-completion/bash_completion, but I'd like to know why another shell is being called when I open terminal. I thought that, since bash is my default, that it would also be used during sourcing.
I've done a
echo $0 just before calling the bash-completion file and the output is
What would cause bash not to be used for sourcing?
Addressing questions from comments:
This happens when I start a new console, which means that the kernel will start a new terminal window, calling the
~/.profile, which in its turn do a
. "$HOME/.bashrc", which will in its turn source the bash completion (
I don't have a
I can't put the
echo "$0" to inside of the bash_completion because it will fail and not be executed.
.profile are the default ones that come with Ubuntu. I don't have a
.bash_profile. You can find them in your local Ubuntu 14.04 under