Can ksh on AIX be configured to use the tab key for filename completion?

I have some AIX 7 servers that are restricted to what software I can install and wonder if I can get ksh to use the tab key to complete filenames at the shell promot.

The man pages are sparse for ksh and I don’t see any relevant questions here covering this ground. Due to the majority of users using ksh, I’m hesitant to shift my shell to bash – but I suppose that’s an easy out.

I log in initially from a PC using putty/ssh and work mostly from xterm once the X11 forwarding brings back the traffic to Hummingbird Exceed on the PC.

Can /usr/bin/ksh that ships with bos.rte.shell for AIX 7.1 be configured to trigger filename completion (which is normally triggered by pressing ESC+ ) by pressing the TAB key?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I gather your shell is in vi mode. Not sure this will work, as my AIX knowledge is limited, but yu can try to add this to your profile:

set -o emacs
bind "^I=complete"

Google says that ksh in AIX is kinda crippled from this point of view, so maybe bash would be a better bet.

Method 2

See if /usr/bin/ksh93 is available:

ksh93 --version

If it says

version         sh (AT&T Research)

then use that as your interactive shell. It will have the ${.sh.version} and should have the TAB expansion.

Method 3

There is an alternative for this question.

First set vi mode for ksh:

$ set -o vi

After, you can use the Tab key this way. Example: You want complete the next path:

$ cd /usr/local/s

Type Tab key twice and You will see this:

$ cd /usr/local/s
1) sbin/
2) share/
3) src/

Assuming you want to option 2 (/usr/local/share/ folder), type 2 Tab (2 key followed by the Tab key). And You will see this:

$ cd /usr/local/share/


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x