LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   terminal arrow keys not playing nice (https://www.linuxquestions.org/questions/solaris-opensolaris-20/terminal-arrow-keys-not-playing-nice-627291/)

madivad 03-11-2008 12:52 PM

terminal arrow keys not playing nice
 
I have just completed an install of solaris 10 on a new box.

When I open a terminal window I cannot use the arrow keys, instead I get control characters printed on the screen instead. This also includes the backspace key.

Also the tab key does not work as expected (ie, it doesnt auto-complete).

However, if once in a terminal, I type 'bash' most things seem to run as normal. Is there something I need to 'activate' to make these keys work as expected?

Thanks

dguitar 03-11-2008 01:04 PM

Solaris doesn't use the Bash Shell by default.

Look in /etc/passwd, at the end of the line for your account, it should say /bin/sh, change that to /bin/bash if you would like to always use bash.

madivad 03-11-2008 07:29 PM

sweet...

That fixed it.

It was: /sbin/sh
and I changed it to: /bin/bash

I'll tweak it to my liking now, ie prompts etc.

On a side note:
One thing I have never done is work with different shells. I have always found bash so easy to use, what are the benefits to /sbin/sh and others? I think there is one called csh as well. To me going back through the commands is more than a nicety, I'd almost say it's a necessity.

Thanks

jlliagre 03-11-2008 07:58 PM

Quote:

Originally Posted by madivad (Post 3085679)
sweet...

That fixed it.

It was: /sbin/sh
and I changed it to: /bin/bash

If it was /sbin/sh, the I suspect you are changing root's shell and that would mean you are using root as your personal account on this machine. This is a very unrecommended practice on every Unix and Unix-like OS. You should create a regular user account and only use root's privileges when required.
Quote:

On a side note:
One thing I have never done is work with different shells. I have always found bash so easy to use, what are the benefits to /sbin/sh and others?
/sbin/sh is the original Bourne shell. It is still maintained as root shell because newer shells, especially the POSIX compliant ones, have incompatibilities that can break legacy shell scripts.
Another advantage: /sbin/sh used to be it was statically linked so it was still usable even when loading dynamic would fail for some reason. This is however no more the case with Solaris 10.

About the shells, it's for a large part a matter of taste. Most Gnu/Linux users stick to bash because it is the default one on these systems and it fits their needs.

Solaris users often prefer ksh because bash wasn't standard on Solaris until the recent years and ksh has some interesting features still missing from bash anyway. Bash users are still often reluctant to switch because the basic history and command editing with the keyboard arrows were missing with ksh. I never missed them because I find the vi commands faster and more productive. Latest ksh releases with Solaris Express finally implement the arrows so everyone should be happy with it.
Quote:

I think there is one called csh as well. To me going back through the commands is more than a nicety
Precisely, csh was the first Unix shell to implement command history. Unfortunately, it is not compatible with Bourne syntax, isn't Posix compliant and has design flaws that make it a very bad choice for scripting.
Quote:

I'd almost say it's a necessity.
Absolutely agree. I'm using ksh93 where available, then ksh and bash at third choice.

I know people very happy with zsh. Zsh go further than ksh and bash in features, but I haven't spent the time to familiarize with it.

madivad 03-11-2008 08:35 PM

Quote:

Originally Posted by jlliagre (Post 3085700)
If it was /sbin/sh, the I suspect you are changing root's shell and that would mean you are using root as your personal account on this machine. This is a very unrecommended practice on every Unix and Unix-like OS.

You are dead-set right. This is a brand new install and still only in setting up phase (only installed it within a couple of hours of the first post here. I admit I was a bit thrown that during the installation I was never prompted for a username (as you are in most linux installs).

Thanks for the reminder (and a user account has already been created <G>)

And thanks for your time and info on the shells as well. Great stuff!

I'll probably play with this for the day, and then go the path of Solaris Express as previously (and elsewhere) suggested.


All times are GMT -5. The time now is 11:36 PM.