Created
October 7, 2013 13:34
-
-
Save robmiller/6868129 to your computer and use it in GitHub Desktop.
I often want to copy the IP address for a hostname to my clipboard. This shell function will do that; drop it in your `.bashrc` or `.zshrc` and you can then call `nscp example.com` to copy the A record for `example.com` to your clipboard. It also outputs it, so you can verify it by eye (or pipe it into something else).
This file contains hidden or 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
function nscp() { | |
nslookup $1 | sed -n 'x;$p' | cut -d' ' -f2 | tee >(pbcopy) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment