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.
short sweet and to-the-point. That works thanks.
ReplyDeleteI had to split the export command in two lines:
ReplyDeleteSHELL=/usr/bin/bash
export SHELL
You are awesome. This is exactly what I have been looking for for the last 20 minutes. Cut and paste works perfectly. I even did a little dance.
ReplyDeleteYep,
ReplyDeleteOn Solaris 10 I had to have the separate export for shell then it worked.
I had to do something a bit different in my environment as my default shell was tcsh. I created a file called ~/.cshrc. I then added the following lines to this file:
ReplyDeletesetenv SHELL /bin/bash
exec SHELL
It worked. thx a lot.
ReplyDeleteThanx a lot.
ReplyDeleteMiloslav Havrda
Thank you, especially "IMPORTANT" section teach us best practices which saves our days..
ReplyDeleteThanks
ReplyDeletethis is brillient work. Thanks mate.
ReplyDeleteMichael Ses.
Melbourne
suggestion: just edit the user's shell parameter in /etc/password
ReplyDeleteRather challenging without root access; the other solutions discussed here work under normal user privileges.
Deleteexec bash will work
ReplyDeleteWorks great but when you invoke bash you should pass the "-l" parameter so that bash will act like a normal login and invoke the .bash_profile.
ReplyDeleteI had a little extra fun on the Solaris system I'm using, since .profile wasn't being executed and starting shell was csh.
ReplyDeleteInstead, I ended up editing .login and adding:
set SHELL="/usr/bin/bash -l"
exec $SHELL
This also works for me as my starting shell was csh.
DeleteThanks a lot.
This worked for me too! my starting shell was csh on a sparc
Deleteworked for me tooo
DeleteThanks
Unfortunately, this does not work when you run the shell from ssh with something like:
ReplyDeletessh user@host ". .profile; ls"
Instead of executing the ls command, it waits for input.
You can also do this per user in /etc/passwd
ReplyDeletesweet and short and works
ReplyDelete