To get your IP address:
/sbin/ifconfig
| grep ‘‘
| sed -n ‘1p’
| tr -s ‘ ‘
| cut -d ‘ ‘ -f3
| cut -d ‘:’ -f2
To get your MAC address:
/sbin/ifconfig
| grep ‘eth0’
| tr -s ‘ ‘
| cut -d ‘ ‘ -f5
If you have awk, you can use:
/sbin/ifconfig|grep ‘eth’| awk ‘{print $5}’
for MAC address and similar for IP address.