Between learning for my examination next week, I need some avocation. So I played around with bash-completion to make daily work more comfortable. Here is my first fast hack. It completes the defined SSH-Hosts. Only put this in your /etc/profile or ~/.bashrc and it should work quite fine.
<pre>SSH_HOSTS=$(grep “^Host “ ~/.ssh/config /etc/ssh/ssh_config | sed -e “s/^Host \(.\)/\1/” -e “s/\//g”)
complete -W “${SSH_HOSTS}” ssh sftp</pre>
Filed under Linux & no comments & one trackback
Trackback specific URI for this entry