AIX via Putty command control

I'm using AIX via Putty.
How can I navigate through latest executed commands like what we can dp in other tools like DOS and CYGWIN (using up and down arrows)
I know that pressing ESC and K will show the latest command on screen ;but even that command can not be edited.

please advise
LVL 11
it-rexAsked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
Hi,

seems that you're using "set -o vi" as the commandline editing option.
So the regular vi keys will work to edit the command, but I think that's not what you desire.

I assume that you're using ksh (since it's AIX), so you can do this:

Set these aliases in /etc/profile or your personal $HOME/.profile:

alias __A=$(echo "\020")   # up arrow = ^p
alias __B=$(echo "\016")   # down arrow = ^n
alias __C=$(echo "\006")   # right arrow = ^f
alias __D=$(echo "\002")   # left arrow = ^b

and add

set -o emacs

to the respective file.

Now log out and log in again. The arrow keys will work, and <ESC><ESC> will do filename completion.

wmp
0
 
johnsoneConnect With a Mentor Senior Oracle DBACommented:
Sounds like you have vi style command line editing in place.

Try using this command:

set -o emacs

This will give you emacs style command line editing and should work more like you are used to with the arrow keys and also being able to edit the command.
0
 
TomuniqueConnect With a Mentor Commented:
Why is everyone pushing him to emacs....??

it-rex...  what do you mean "that command can not be edited"?

Try this;
Does your backspace key give you ^? characters...
If so, putty is mis-configured for AIX.
In putty window, on the title-bar, select the icon to the far left, go to "change settings"
this brings up the config window.. (on the left under terminal->keyboard)  ensure backspace is set to control-H

You could also change it from AIX by using the "stty erase" command   passing it a "space backspace" parm
ie:   stty erase  ^?    (is what it may appear ^? representing your backspace key)


IF this isn't your problem, maybe  it's your understanding of the vi command line editor.
when you press esc-k/j scroll up/down tthrough your command history  
you can press escape again to enter "edit mode".

These are your standard "vi" ascii terminal keys.
h = left
l=right
x=delete
cw=change word
etc
You can even search your command history by using /

Can you please explain what problem you're seeing, if the above doesn't help.

0
 
johnsoneSenior Oracle DBACommented:
Pushing to emacs as it would be closer to the DOS style command line editing that it seemed they are looking for.

Personally, I prefer the emacs style over the vi style.  However, I know both vi and emacs pretty well and can use either.
0
 
it-rexAuthor Commented:
thanks
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.