Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with word complete

Status
Not open for further replies.

minus0

Programmer
Joined
Feb 20, 2003
Messages
73
Location
US
How do you turn the word complete/auto complete feature on in Unix - I know there is a filec variable that needs to be set in the C Shell but what about sh/ksh/bash?

In case I am not making sense here, when you have a file called LongFileName.log and you don't want to type the entire name but type LongF at the prompt, auto complete helps you out by filling the rest of the name - I set it to and Escape followed by a backslash but forgot how I did this. Can some one help me out?

Appreciate your help
 
do 'man bash' and search for 'inputrc' - should get you started.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
well, my question was more like how do I set the auto completion feature to say, a TAB key or something. so set disable-completion [on|off] wont help me and I did do a man on sh before posting a question, didn't find any thing related to auto completion, unless I some how missed it.
 
well.... do man on either ksh or bash

look for 'inputrc' and 'tabcomplete'


set -o tabcomplete

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 

Maybe if you were a bit more clear on which shell you're actually using.

If bash use my method.

Cheers
 
hi unixfreak,

I did mention in my first post, I need this for sh/ksh/bash. I dont really care about bash but sh/ksh I do. I don't have access to a Unix box from home, so I will have to wait till I get back to work after the thanksgiving holidays.
Once again Thanks for your help.
 
For the Korn shell on Solaris, I believe it's...
Code:
    set -o emacs
    set +f
Then just tap the Escape key twice for completion.

You can also use the arrow keys for command line recall and editing by putting these commands into either your .profile, or an environment file (i.e. .kshrc)...
Code:
    alias __A=^P
    alias __B=^N
    alias __C=^F
    alias __D=^B
...where ^P, ^N, ^F, and ^B are Control-P (octal 020), Control-N (octal 016), Control-F (octal 006), and Control-B (octal 002). You'll need an editor that will let you put these control characters in there. And that's two underscore characters in front of the A, B, C, and D.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top