While following instructions at a forum post to install something over ssh at an external machine, I executed the following command without thinking:
. .bashrc
I have never seen the command before but am guessing (from having had a similar problem previously) that it recursively sources ~/.bashrc
because now I can't execute any commands. When I login, I can't do anything. I immediately get:
-bash: /usr/bin/whoami: Argument list too long
-bash: /usr/bin/cut: Argument list too long
-bash: /usr/bin/logger: Argument list too long
Unfortunately, I can't do what solved the problem when I had a similar problem in the past (login without using the bash shell by doing ssh -t user@host /bin/sh
and then modify ~/.bashrc
) because there does not seem to be any problem with ~/.bashrc
. It looks exactly the same as it did before I messed up.
Whatever I did, modifying ~/.bashrc
does not appear to be a fix. Can anyone please suggest an alternative solution?
Here is ~/.bashrc
:
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH=$PATH:$HOME/.local/bin:$HOME/bin/prog1:$PATH
export PATH=$PATH:$HOME/.local/bin:$HOME/bin/prog2:$PATH
export PATH=$PATH:$HOME/.local/bin:$HOME/prog2:$PATH
export PATH=$PATH:$HOME/.local/bin:$HOME/prog2/bin:$PATH
export PATH=$PATH:$HOME/.local/bin:$HOME/bin/prog3/tools/newtool:$PATH
export PYTHONPATH=$PATH:$HOME/.local/bin:$HOME/prog2:$PYTHONPATH
$HOME/.bashrc
to your question..bashrc
, it comes from some other configuration file. This could be/etc/bashrc
or something else. What is the output of the following command?set -x; ulimit -a; echo foo; /bin/echo bar