Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Need to know the IP address of a host in your ~/.ssh/config ?
- # Add this to your .zshrc:
- # show ip address for ssh host, with zsh completion for hostname
- _sship () { ssh -G $1 | awk '/^hostname/ {print $2}' }
- compdef _sship=ssh
- # Usage
- # =====
- # Add the above two lines to the bottom of your ~/.zshrc file.
- #
- # Use it like this on the commandline:
- #
- # _sship somebox1
- # 11.22.33.44 # <= this is what it will print
- #
- # This is what your ~/.ssh/config might look like:
- #
- # Host somebox1
- # HostName 11.22.33.44
- # Host otherbox22
- # LocalForward 1234 localhost:4567
- # HostName 22.33.44.55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement