-   Linux - General (
-   -   Bash auto-completion question (

PatrickNew 05-02-2008 01:29 AM

Bash auto-completion question
So I noticed something odd the other day. My bash (Debian lenny) will autocomplete commands for me, as expected. However, for some commands, it will also autocomplete the options. For, example, if I type "dd ib" and then hit tab, it will complete to "dd ibs=".

How do these programs go about notifying bash of their options? Is there some method of pre-registering? Or are all of these commands actually bash builtins?

GosthMan 05-02-2008 01:51 AM

yes you can make add commands to bash completition using alias
alias "ps-status"="ps aux"
this will add the command ps-status to bash
Or if you have an custom made bash script you can create an simlink to /sbin/

elliott678 05-02-2008 01:56 AM

It should be the same in Debian as it is in Arch, check out /etc/bash_completion and maybe /etc/bash_completion.d/ if it exists.

PatrickNew 05-02-2008 11:31 PM

That makes a lot more sense now, thanks! I didn't know about that config file, cool.

All times are GMT -5. The time now is 11:59 AM.