-
-
Save mathiasgrimm/f705594a86446365c8a589aefb9584ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# grep will be use if one argument is provided | |
# eg.: sshs prod | |
# this will only output hosts that have prod in their name | |
if [ "$#" -ne 1 ] | |
then | |
cat ~/.ssh/config|grep 'Host '|awk -F ' ' '{print $2}' | |
else | |
cat ~/.ssh/config|grep 'Host '|awk -F ' ' '{print $2}'|grep $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment