Solved

AIX via Putty command control

Posted on 2011-09-28
5
1,291 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 34

Assisted Solution

by:johnsone
johnsone earned 150 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 250 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 100 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 34

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now