Get server’s IP from bash

ifconfig | sed -n 's/.*inet addr:\([0-9.]\+\)\s.*/\1/p' | grep -v '127.0'

Or with less messing up your head:

ifconfig eth0 | grep 'inet addr:' | awk '{print $2}' | sed 's/addr://'