Skip to content

Instantly share code, notes, and snippets.

@warthurton
Created August 4, 2011 19:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save warthurton/1126037 to your computer and use it in GitHub Desktop.
Save warthurton/1126037 to your computer and use it in GitHub Desktop.
TextExpander Local IP
#!/bin/bash
active_interface=`netstat -rn | grep 'default' | awk '{print $6}'`
ifconfig | grep -A 1 $active_interface | grep 'inet ' | awk '{printf $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment