Solved

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

Posted on 2015-01-27
5
2,031 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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 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

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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…
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 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.:

691 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