If I want to display the IP address that is assigned to eth1, how can I do this in Bash?
Try this (Linux)
or this (Linux)
or this (*BSD)
or this (Solaris 10)
Obviously change the interface name to match the one you want to get the information from.
A better way: get ip adress from command "ip", because "ifconfig" is out of date. Otherwise you will get a problem on using "ifconfig", because the output of ifconfig is language dependend.
I use this command to get all IPs (IPv4):