Added sshosts to view all the ssh config hosts that have been added. This command will only print out the host names

that you would use for ssh/scp.
pull/11/head
Robert R Evans 2010-10-12 10:11:21 -07:00
parent b110de49b9
commit 50b19d8bef
1 changed files with 4 additions and 0 deletions

View File

@ -3,3 +3,7 @@
function add_ssh() { function add_ssh() {
echo -en "\n\nHost $1\n HostName $2\n User $3\n ServerAliveInterval 30\n ServerAliveCountMax 120" >> ~/.ssh/config echo -en "\n\nHost $1\n HostName $2\n User $3\n ServerAliveInterval 30\n ServerAliveCountMax 120" >> ~/.ssh/config
} }
function sshosts() {
awk '$1 ~ /Host$/ { print $2 }' ~/.ssh/config
}