Saturday, March 15, 2008

Change the Solaris Shell to Bash

For those of us that are stuck working in Solaris environments with either csh or ksh as the default shell, there is hope. Some of these environments have the chsh command to change shells, but for those that don't, here is how to change your shell to bash. First of all, make sure it is available on your system. It's typically found in /bin/bash. If it's there, you can edit your ~/.profile to make it run the new shell when you login.

IMPORTANT: Before doing this, open two separate shells. Keeping one open and unaltered is a good way to recover if something goes wrong in this process. If you break something and can't log in, you may piss off your system admin when you have to call him to fix it for you. Leave one of these open shells alone during this process.

In one of your open shells, add the following two lines to the bottom of your ~/.profile.

export SHELL=/bin/bash
exec $SHELL

You can now log out of that shell and back in again to see if it worked. If so, all went well and you can close the other shell. If not, use your "safety" shell to repair your ~/.profile so that you can log in again.