1

Is there an easy way to programmatically extract IP address?

view story
linux-howto

http://unix.stackexchange.com – Is there an easy way to programmatically extract IP address, without tedious parsing of ifconfig? I would not mind simple command output processing using sed to do it but not processing multiline files from /etc some place. What I am trying to do is modify my .bashrc to display the IP address of the host in the greeting message. I am using Ubuntu 12.04 but decided to post here instead of the Ubuntu forum because I consider this to be not distro-specific. (HowTos)