?
Solved

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

Posted on 2015-01-27
5
Medium Priority
?
2,512 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 2000 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 62

Expert Comment

by:gheist
ID: 40574007
set -o vi

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

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 10

Author Closing Comment

by:Carlos Ijalba
ID: 40574792
Thanks!
0
 

Expert Comment

by:Sathees Kumar
ID: 41797484
@woolmilkporc: Thanks! It helped.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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.:
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.
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 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