LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-11-2008, 12:52 PM   #1
madivad
Member
 
Registered: Jan 2007
Posts: 70

Rep: Reputation: 15
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
 
Old 03-11-2008, 01:04 PM   #2
dguitar
Member
 
Registered: Jun 2005
Location: Portland, ME
Distribution: Slackware 13, CentOS 5.3, FBSD 7.2, OBSD 4.6, Fedora 11
Posts: 122

Rep: Reputation: 17
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.
 
Old 03-11-2008, 07:29 PM   #3
madivad
Member
 
Registered: Jan 2007
Posts: 70

Original Poster
Rep: Reputation: 15
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
 
Old 03-11-2008, 07:58 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,763

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
Quote:
Originally Posted by madivad View Post
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.

Last edited by jlliagre; 03-11-2008 at 08:43 PM.
 
Old 03-11-2008, 08:35 PM   #5
madivad
Member
 
Registered: Jan 2007
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlliagre View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gnome-terminal: vi and arrow keys psychobyte Ubuntu 7 05-02-2007 10:10 PM
Arrow keys not working flamingvan Solaris / OpenSolaris 5 10-03-2006 05:47 AM
Shift-arrow and Alt-arrow keys don't work in xterm Aviv Hurvitz Linux - General 2 09-30-2006 03:43 PM
Scroll with arrow keys in the terminal window? halfpower Debian 1 09-28-2005 04:59 AM
Arrow keys in nethack Levitate Linux - Games 3 08-22-2004 11:44 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration