Skip to content

Instantly share code, notes, and snippets.

@martijnvermaat
Created May 11, 2016 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martijnvermaat/581c9752094764c0d59dac76cfbffa53 to your computer and use it in GitHub Desktop.
Save martijnvermaat/581c9752094764c0d59dac76cfbffa53 to your computer and use it in GitHub Desktop.
Auto SSH session aliases for hosts configured in ~/.ssh/config
# 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