#!/bin/sh # Usage: addr [] # Show IPv4 address for interface or all interfaces with # no given. # Darwin/OSX ifconfig -a | grep 'inet ' | grep broadcast | awk '{ print $2 }' # Linux ifconfig -a | grep 'inet ' | grep Bcast | awk '{ print $2 }'