Thursday, July 5, 2012

ssh completion

in .bashrc put
function _ssh_completion() {
    perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config
}
complete -W "$(_ssh_completion)" ssh
and source it or restart the terminal

No comments: