Solved

[AIX] Is TAB autocomplete and CURSOR KEYS history navigation viable?

Posted on 2015-01-27
5
1,605 Views
1 Endorsement
Last Modified: 2016-09-14
A customer asks me if it's possible to enable file autocompletion under AIX and also history navigation through the cursor keys, basically to have AIX cli with the same behaviour as Linux/Windows.

I know that under ksh file autocompletion is done through Esc+/, and history navigation with Esc+k and Esc+j.

I have tried with the extended shell available under AIX v7.1.0.0 (ksh93) but so far had no luck.

Has anyone ever done this in AIX??? Is it posible without installing bash or ksh98?
1
Comment
Question by:Carlos Ijalba
5 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 40573547
The "emacs" option enables  autocompletion under AIX (ksh) by hitting <ESC> twice, and
you can define aliases to enable history navigation using the arrow keys.

Add the following to your ".profile" (for individual use) or to "/etc/profile" (for system wide use):

set -o emacs
alias __A=`echo "\020"`   # up arrow = previous command
alias __B=`echo "\016"`   # down arrow = next command
alias __C=`echo "\006"`   # right arrow = cusror right
alias __D=`echo "\002"`   # left arrow= cursor left

If you add it to /etc/profile take care to remove "set -o vi" from there. In any case remove "set -o vi" from any private .profile which is going to use "emacs".

As said above, hit the <ESC> key twice for autocompletion. The <TAB> key cannot be used for this, unfortunately.
1
 
LVL 61

Expert Comment

by:gheist
ID: 40574007
set -o vi

and use shell as vi editor.
JKLH - move
rest you will learn fast.
0
 
LVL 9

Author Comment

by:Carlos Ijalba
ID: 40574791
Thanks guys,

@woolmilkproc: thanks, i've never tried the emacs mode before, always used vi, but it works OK for what my customer wanted. So: problem sorted!

@gheist: thanks, i showed my client vi mode, but it gets difficult if you are windows admin, plus in a spanish keyboard autocomplete means Esc+Alt Gr+\, which is jumping all over the keyboard compared with a simple tab.
Double Esc is faster.
0
 
LVL 9

Author Closing Comment

by:Carlos Ijalba
ID: 40574792
Thanks!
0
 

Expert Comment

by:Sathees Kumar
ID: 41797484
@woolmilkporc: Thanks! It helped.
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

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…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

911 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