1826004 Members
3289 Online
109690 Solutions
New Discussion

Command auto-Completion

 
SOLVED
Go to solution
Puneet Singh tandon
Frequent Advisor

Command auto-Completion

I need to know the configuration/environment/profile changes to use command auto completion feature which is available in other linux distros by default(using tab)
16 REPLIES 16
Torsten.
Acclaimed Contributor

Re: Command auto-Completion

You will have the functionality if you run bash as your shell.

Do NOT configure bash as default for root in /etc/passwd!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Delrish
Trusted Contributor

Re: Command auto-Completion

First of all, please inform us about your shell. each of the shells has specific method for this issue
Puneet Singh tandon
Frequent Advisor

Re: Command auto-Completion

I am using sh as the shell.
Steven E. Protter
Exalted Contributor

Re: Command auto-Completion

Shalom Moodie,

echo $SHELL

Tab completion is the default for any Linux distro I know. What are you using?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Puneet Singh tandon
Frequent Advisor

Re: Command auto-Completion

Hey ,
I am using HP-UX11.11
and the shell(user) is /usr/bin/sh
and the shell(root) is /sbin/sh
Ivan Ferreira
Honored Contributor

Re: Command auto-Completion

You should install bash for hp-ux. Download it from here:

http://hpux.connect.org.uk/hppd/hpux/Shells/bash-3.00.16/

Change your shell to be bash.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vipulinux
Respected Contributor

Re: Command auto-Completion

Hi

You can also try ksh, if you dont wanna use bash

Cheers
Torsten.
Acclaimed Contributor

Re: Command auto-Completion


@ HP moderator:

Your are moving the threads too quickly!

quote from this thread:

"I am using HP-UX11.11"

Why this thread is moved to the linux forum?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor
Solution

Re: Command auto-Completion

Hi Moodle:

If you are running HP-UX, you can do file-name (or path-name) completion by typing ESCape, ESCape after partially entering a filename.

If you are running HP-UX, *never* change 'root's default shell from '/sbin/sh'. To do so will lead to an unbootable system. The standard POSIX shell resides in '/sbin/sh' with statically linked libraries. The same shell with dynamically linked libraries to reduce the memory footprint lives in '/usr/bin'. Since, '/usr' isn't mounted during the initial startup sequence, the default shell for root must be '/sbin/sh'.

Regards!

...JRF...

Puneet Singh tandon
Frequent Advisor

Re: Command auto-Completion

Thanks for the Warning.
But ESCape doesnt have any effect in my case.
How do i check my command completion
sequence is set to what????
James R. Ferguson
Acclaimed Contributor

Re: Command auto-Completion

Hi (again) Moodie:

Given HP-UX, hitting the ESCape key *twice* after typing enough characters to make the filename unique, should cause auto-completion.

Given two files in the current working directory; each beginning with "p" :

# ls -l p

...will *not* auto-complete, but:

# ls -l po

...when the files "peek" and "poke" exist, will offer "ls -l poke".

Regards!

...JRF...
Puneet Singh tandon
Frequent Advisor

Re: Command auto-Completion

Hey JRF,
Could nt get any command auto completion but these characters ^[ only
Any suggestions
Stuart Browne
Honored Contributor

Re: Command auto-Completion

In most shells which do command-completion, '' is used as a replacement for the single '' press. So to get a list of matches, you'd do:

ls -al p

You'd get a BEL after the 2nd , and the list of matching commands after the 4th.

Now, if this doesn't work, check your 'stty' bindings to ensure that '' (^[) isn't bound to some other function ('stty -a' for the full list).
One long-haired git at your service...
Puneet Singh tandon
Frequent Advisor

Re: Command auto-Completion

No the escape ^[ isnt bind to anything.
Following is the stty -a log.


# stty -a
speed 9600 baud; line = 0;
rows = 40; columns = 140
min = 0; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 = ^@; swtch = ^@
stop = ^S; start = ^Q; susp = ^Z; dsusp = ^@
werase = ^@; lnext = ^@
parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon iexten -xcase echo echoe echok -echonl -noflsh
echoctl -echoprt echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop
Matti_Kurkela
Honored Contributor

Re: Command auto-Completion

The "stty -a" command lists only the bindings done at the tty driver level. They are in effect in all the programs run in that terminal session unless overridden, so they must be very generic.

The shell has its own set of key bindings, unrelated to "stty -a" settings. Each shell has its own ways for setting up these bindings: for example, bash's key bindings can be listed with "bind -p".
MK
Puneet Singh tandon
Frequent Advisor

Re: Command auto-Completion

Thank you evrybdy