> I could do this for ipv4 of my wireless card: > > ifconfig wlan0 | grep "inet addr" | sed -e "s/inet addr://" | \ > sed -e "s/ Bcast.*//" > > Putting it into a shell script should be simple enough That's some mad pipage. If you're using sed there's no reason to use grep at all: ifconfig eth0 | sed -n 's/^.*addr:\(.*\) B.*$/\1/p' Cheers, Jason