Last active
October 12, 2015 17:17
-
-
Save charlestang/4060351 to your computer and use it in GitHub Desktop.
Interactively selecting server to connect from config file
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
#!/bin/bash | |
server_config=~/.ssh/server_config | |
echo 'Servers:' | |
cat -n $server_config | |
echo 'Please seletct: >' | |
read n | |
echo 'Connecting....' | |
command=`sed -n ${n}p $server_config | awk -F'#' '{ print $1; }'` | |
$command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
server_config 文件的格式如下