1

Currently I am in /xhbin/tcsh. which command changes me to /bin/bash? Do I need to change the $SHELL variable or something like that?

2
  • Changes you where for how long? Jul 15, 2011 at 9:11
  • permanently I what I am looking for.
    – Mark
    Jul 15, 2011 at 9:35

3 Answers 3

4

To change shells temporarily, simply run the new shell. They're like any other program.

snow:~> bash

grawity@snow:~$

Use exit or Ctrl-D to go back.


To change the shell permanently, use chsh:

chsh -s /bin/bash

You must provide the full path to the new shell (use which bash to find out). Also, chsh may not work on centralized logon systems.

2

Just run /bin/bash? That will only last for your current session though.

0

As @grawity mentions, chsh may not always work. I have a server for which my login shell is ksh and I like to use bash interactively. This is my ksh .profile:

# my login shell is /bin/ksh
# this profile should spawn bash without re-invoking this profile

bash_opt='--noprofile'
[ -r .bash_profile ] && bash_opt='--login'

echo "spawning bash $bash_opt"
exec /usr/bin/bash $bash_opt

You must log in to answer this question.

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