Host Completion in bash
![]() |
bash has programmable parameter completion, so you could set hostname completion up by coding it yourself. That's not necessary, though. Instead, you can pick up the bash completion files (also available as the bash-completion package in RH, Debian and from Darwin Ports for Mac OS X).
Once you've installed that, type:
. /etc/bash_completion |
|
Recent Tips » More Fun With ssh » Keeping Your ssh Connection Alive » 3 Apache/httpd Command-Line Options Read All Tips of the Trade |
This takes information from your .ssh/known_hosts file. It works automatically for ssh and similar commands, but you can also set other commands to use it. For example, maybe you have a script called 'update' which updates a particular host. Type:
complete -F _known_hosts update |
To investigate programmable completion options more, complete -p will list all the currently available completions.
Page
1 of
1
0 Comments (click to add your comment)
Networking Solutions

