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.

I have a few separate programs installed, some of which require me to go into my GUI terminal settings and enable/disable the "Run command as a login shell" option to get either working.

Example:

I installed Ruby on Rails. Unfortunately I have to go into the terminal options and enable "Run command as login shell" for it to be in my PATH.

This wasn't too much of an issue up until I installed sexy-bash-prompt, which works only if the option is disabled.

So my question is essentially: what does "Run command as login shell" do? Is there a way to get the things that run when it's disabled to run when you do run as login shell?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Assuming that your shell is Bash (the default in Ubuntu), these are the differences:

  • When running as a login shell, Bash will read ~/.bash_profile (or, if that doesn't exist, ~/.profile) on startup. In some cases, this file reads ~/.bashrc as well.

  • When running as a non-login shell, Bash will read ~/.bashrc.

So, why do you see different behaviors when running as a login/non-login shell? Because your .bash_profile/.profile is doing different things than your .bashrc.

The solution I would recommend in your case is to copy the customizations made to .bash_profile/.profile, paste them into .bashrc and disable "Run command as a login shell".

share|improve this answer
    
Ahh ok. I figured it had to do with what login profile it read (source'ing .bashrc fixes some of the issues I had). I'll give that a go, sorry for the horribly written question. –  Dropped.on.Caprica Aug 26 '13 at 15:06
    
Great answer, very informative. –  Travis Bear Nov 7 '13 at 23:40

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.