Skip to content

Instantly share code, notes, and snippets.

@connormckelvey
Created March 26, 2014 20:05
Show Gist options
  • Select an option

  • Save connormckelvey/9791993 to your computer and use it in GitHub Desktop.

Select an option

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

jhebb commented Oct 9, 2014

Copy link
Copy Markdown

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