?
Solved

AIX via Putty command control

Posted on 2011-09-28
5
Medium Priority
?
1,499 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:it-rex
5 Comments
 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 600 total points
ID: 36718751
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
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 1000 total points
ID: 36718777
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
 
LVL 6

Assisted Solution

by:Tomunique
Tomunique earned 400 total points
ID: 36814782
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
 
LVL 35

Expert Comment

by:johnsone
ID: 36815455
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
 
LVL 11

Author Closing Comment

by:it-rex
ID: 36903585
thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question