Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. # Need to know the IP address of a host in your ~/.ssh/config ?
  2. # Add this to your .zshrc:
  3.  
  4. # show ip address for ssh host, with zsh completion for hostname
  5. _sship () { ssh -G $1 | awk '/^hostname/ {print $2}' }
  6. compdef _sship=ssh
  7.  
  8.  
  9. # Usage
  10. # =====
  11. # Add the above two lines to the bottom of your ~/.zshrc file.
  12. #
  13. # Use it like this on the commandline:
  14. #
  15. # _sship somebox1
  16. # 11.22.33.44 # <= this is what it will print
  17. #
  18. # This is what your ~/.ssh/config might look like:
  19. #
  20. # Host somebox1
  21. # HostName 11.22.33.44
  22. # Host otherbox22
  23. # LocalForward 1234 localhost:4567
  24. # HostName 22.33.44.55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement