Awesome- .bashrc tab autocompletion of known hostnames
Here’s one of those what-did-I-do-before-i-met-you ideas,
SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | cut -f 1 -d " " | \sed -e s/,.*//g | uniq ) );
complete -o default -W "${SSH_COMPLETE[*]}" ssh
Put that in .bashrc and you get tab autocompletion of hostnames for anything in your known_hosts file. Thanks to Nate for this one.
March 30, 2012
• Posted in: Blogging
Leave a Reply