Solved

AIX via Putty command control

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sudo logging 5 80
Generate FIPS 140-2 Public Key on Unix 5 66
Skill Development 15 163
SCP a file to multiple machines using a script 4 16
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

910 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

24 Experts available now in Live!

Get 1:1 Help Now