Created
April 27, 2010 02:41
-
-
Save ecarter/380261 to your computer and use it in GitHub Desktop.
ssh bash complete using ~/.ssh/config and hosts
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
complete -C "perl -le '\$p=qq#^\$ARGV[1]#;@ARGV=q#$HOME/.ssh/config#;/\$p/&&/^\D/&¬(/[*?]/)&&print for map{split/\s+/}grep{s/^\s*Host(?:Name)?\s+//i}<>'" ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment