Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
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.Belanger Jan 20 at 16:56
add comment

2 Answers

up vote 0 down vote accepted

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?)

share|improve this answer
add comment

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

# cat /etc/passwd
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.