1828366 Members
2830 Online
109976 Solutions
New Discussion

Command Completion

 
Rick Copley
Advisor

Command Completion

Is it possible to do Command Line Completion using the "Up-Arrow" cursor? I see you can put this in place for TAB. Either way is fine, but the Cursor Up-Arrow method is perferred. Wondering if someone knows how to put this in place?

Tks,
-Ken
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Command Completion

Thats how Linux fuctions out of the box,just like windows.

The tab key completes filenames.

If its not working for you, your stty settings aren't right.

Here are mine.

[invest@jerusalem mail]$ stty -a | more
speed 9600 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ;
eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

I have full functionality on my Linux boxes.


OT:HP-UX does not conform to this standard btw.

P
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
Stuart Browne
Honored Contributor

Re: Command Completion

Actually, it's a function of the shell that's in use.

On a Linux box, the default shell is usally "bash".

Bash uses the 'readline' libraries to take input, and the TAB completion is part of it.

I'm unaware of a way to change the completion character, and the bash man page doesn't mention the ability to do this.

Sorry.
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: Command Completion

Lastly the command completion in Linux is pretty nice. Messing around with it will confuse the next guy that works on the system.

P
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
Steven E. Protter
Exalted Contributor

Re: Command Completion

Not Lastly. With regards to what Stuart said, its actually a combination between the shell and the ssty settings.

If the shell supports completion with the tab key and the stty settings don't handle that, command completion won't happen.

P
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