get ip address:
LANG=C ip a show eth0 | grep ‘inet‘ | grep -v ‘inet6‘ | awk ‘{print $2;}‘ | cut -d‘/‘ -f1`
shell example
原文:http://www.cnblogs.com/yaoweilei/p/5523596.html