Created
May 11, 2016 13:55
-
-
Save martijnvermaat/581c9752094764c0d59dac76cfbffa53 to your computer and use it in GitHub Desktop.
Auto SSH session aliases for hosts configured in ~/.ssh/config
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
# Auto SSH session aliases for hosts configured in ~/.ssh/config. | |
command_not_found_handle() { | |
if [[ ! "$1" ]] ; then | |
return 127 | |
fi | |
if ! grep -q "^Host $1\$" ~/.ssh/config; then | |
return 127 | |
fi | |
ssh $* | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment