?
Solved

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

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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 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.
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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