Created
July 14, 2015 08:04
-
-
Save PercussiveRepair/bbe018d948d46bce236e to your computer and use it in GitHub Desktop.
.ssh/config autocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config | |
# ssh autocomplete based on ~/.ssh/config | |
# I use this in my bashrc to expand hosts defined in ~/.ssh/config: | |
function _ssh_completion() { | |
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config | |
} | |
complete -W "$(_ssh_completion)" ssh | |
# Here's a great article on how to setup your own ~/.ssh/config: | |
# http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment