Sometime on Sep 14, dodobh@nettaxi.com assembled some asciibets to say:
/sbin/ifconfig|grep P-t-P|tr -s ' '|cut -f 4 -d ' '|tr -d adr:
I use this:
#!/bin/bash
[ $# -lt 1 ] && DEV="" || DEV=$1 MYIP=$(/sbin/ifconfig $DEV | grep "inet addr" | cut -f2 -d: | cut -f1 -d' ') echo "$MYIP"
Which optionally takes a device name on the command line. If no device is specified, shows IPs of all interfaces.
Philip