auto-ssh-hosts.zsh 293 B

12345678910111213
  1. # Automagic ssh to known hosts.
  2. #
  3. # Works in conjunction with .ssh/config for username@hostname
  4. ## hosts file
  5. alias hosts='sudo vim /etc/hosts'
  6. local _myhosts
  7. _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
  8. for host in $_myhosts; do
  9. alias $host="ssh $host"
  10. done