Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Zsh is better than bash(obviously), but for some reason, from time to time I have to use bash. I am wondering is there any way for me to use them together without changeing them manually?

What I have in mind is putting them in seperate tabs, I have tried it actually. Using zsh as default, and open another tab using different profile opening bash, though this can work, but all the configurations for bash didn't work.

So can anyone help me out here, thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If by “all the configurations for bash didn’t work” you mean that customizations made in ~/.bash_profile (or ~/.profile or ~/.login) aren’t taking effect, that’s because bash is being invoked as a non-login shell (it runs ~/.bashrc instead).

To make it a login shell, the simplest solution is to add the -l option:

bash -l

Alternatively, if you want to actually create a login session you can invoke it via the login command. This creates a new login session (as displayed by the who command) and it invokes bash with the name -bash (as displayed by ps) to indicate it’s a login shell (same effect as the -l option):

login -f username bash
share|improve this answer
    
-l option really helps! –  Sean Mar 12 '12 at 6:58

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.