0

Upon opening a new terminal window, I'm getting a blank prompt with a flashing cursor.

New terminal window / blank promp (image)

This just started happening the last couple days and I can't seem to find a solution. Prior to this, I modified .bashrc to shorten the working directory. I also included some RVM scripts for configuring a Rails environment.

#   01/15/14 
#   Hide working directory on prompt
    export PS1="\W: "

#   RVM Scripts
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm

I can get a working prompt by entering ctrl+c, however, this then ignores the .bashrc snippet for shortening the working directory.

Working prompt (image)

Rebooting does not solve this.

1
  • I was able to get everything working by simply removing the '.profile' line in .bashrc and restarting the terminal. Thank you @falconer for the explanation.
    – Kyle
    Jan 20, 2014 at 16:56

2 Answers 2

0

This

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"

will source your .profile file in your .bashrc

On my Ubuntu install and I think on all Ubuntu/Debian install .profile contains this:

if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

That means your .profilealso sources your .bashrc. So you get into a nice infinite loop.

Don't source .profile from .bashrc, it is unnecessary. Remove that line.

(What I don't understand how can you login at all?)

0

Are you shure, that you have sh/bash access? Can you please post

# cat /etc/passwd

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .