Skip to content

Instantly share code, notes, and snippets.

@scottgwald
Last active August 29, 2015 14:27
Show Gist options
  • Save scottgwald/0a98f4d04e7f94ccbf83 to your computer and use it in GitHub Desktop.
Save scottgwald/0a98f4d04e7f94ccbf83 to your computer and use it in GitHub Desktop.
get ip address on local 192 network (cross-platform is TODO, mac os x for now)
#! /bin/bash
ipline=$(ifconfig | grep inet | grep " 192")
ip=$(echo $ipline | sed 's/inet \([^ ]*\).*/\1/g')
echo $ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment