I just started using a Solaris 10 (Sparc) box where I telnet in and get confronted with a very unfriendly interface (compared to the standard bash shell I use in cygwin or linux) — the arrow keys do not work as I expect them to. Being an NIS system, changing the shell is not as easy as using the “chsh” command. And setting the SHELL environment variable in ~/.login and ~/.profile is not working for me. So I’m thinking that I may need to write a script to determine if bash is running the script and starting bash if the answer is no. My first attempt, trying to invoke /bin/bash from ~/.profile seems to work but kind of doesn’t feel right. Other suggestions? And how do I tell programmatically which shell is actually executing?
Share
You can tell what shell is running with
echo $0. For example:If you’re changing shell you probably want to replace the current shell process rather than be a child of it, so use
exec.Also, you want to pass
bashthe-lflag so it acts as if it has been called as part of the login process.So you’ll want something like: