Recalling previous commands in Solaris by pressing Up arrow key


I remember on Digital Unix & OpenVMS, I can always recall previous command
by pressing the Up arrow key.

How can I achieve this on Solaris 10 (ssh login using putty)?
sunhuxAsked:
Who is Participating?
 
Abhishek_ChibCommented:
0
 
sunhuxAuthor Commented:

In Korn or Bourne shell, we can issue "r a_substring_of_previous_command"
& It would retrieve back that past command while for C-Shell it's
"! a_substring_of_previous_command".

But this is not what I wanted.  I wanted that by pressing Up arrow key once,
it would recall the last command & by pressing Up arrow key twice, it would
recall the last last command & so on .....
0
 
arnoldCommented:
When you hit the arrows, do you get the control keys?
Check which terminal type you have set? echo $TERM?
vt100, ansi, xterm, etc. .
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
gheistCommented:
if you are using ksh

set -o vi

esc k up esc j down etc vi-like syntax.
0
 
AmolCommented:
use "bash"on your command prompt.
0
 
sunhuxAuthor Commented:


Arnold, I'm on xterm.


To use bash, is it better to change the Shell in
/etc/passwd  or  insert a line "/bin/bash"  into
$HOME/.profile of that user?  Which method would
enable recall of previous commands using Up arrow
key?
0
 
arnoldCommented:
the shell provides the feature, change in passwd will mean there will be one fewer processes on the system. (sh, /bin/bash)
0
 
sunhuxAuthor Commented:
ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.