I am creating a shell script that should do some local settings and echo the IP of the machine in a text file. The reason I need to do this is to get the IP in a PHP script and use it from there as root for a site.
I can get the IP using ifconfig but I need to strip the useless information. I'd like to do this in the shell script not in the PHP file.
The OS is CentOS 5.5, I need the IP of eth0.