Solved

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

Posted on 2015-01-27
5
1,495 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
Comment Utility
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
Comment Utility
set -o vi

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

Author Comment

by:Carlos Ijalba
Comment Utility
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
Comment Utility
Thanks!
0
 

Expert Comment

by:Sathees Kumar
Comment Utility
@woolmilkporc: Thanks! It helped.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.

771 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

10 Experts available now in Live!

Get 1:1 Help Now