Skip to content

Instantly share code, notes, and snippets.

@connormckelvey
Created March 26, 2014 20:05
Show Gist options
  • Save connormckelvey/9791993 to your computer and use it in GitHub Desktop.
Save connormckelvey/9791993 to your computer and use it in GitHub Desktop.
Copy IP of hostname to Clipboard
function tip(){
host -t a $1 | awk '{print $4}' | egrep ^[1-9] | pbcopy
}
@jhebb
Copy link

jhebb commented Oct 9, 2014

This is great! Tried a few different things to echo the ip to the screen as well, but couldn't get it working. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment