Using bash by default

I much prefer to use bash as my main shell, but in Solaris, you are much better off using the default shell, particularly for root, just in case there is a problem and you cannot mount the /usr directory during a boot.OK, it may not happen often (and in fact, the default install is now to have only one partition for the Solaris OS, one for user files and swap), but I figure it is best to err on the side of caution.The best way to do this is to configure your .profile to exec /usr/bin/bash if it is available, but do nothing otherwise, like this:

if [ -x /usr/bin/bash ]then    exec /usr/bin/bashfi

Using exec means that the Bourne shell (sh) will be replaced by bash, so when you logout, you don’t have to logout from two shells.Obviously you can continue to put whatever you like into the standard .profile according to your needs, while using the .bash* init scripts to do your custom bash operations.