I want to edit the bashrc file to have a simple function called \"myip\" to run. As you might guess, the function myip prints only my internal IP address of my machine.
There is another easy way to get the IP address apart from parsing ifconfig.
hostname -I -I, --all-ip-addresses all addresses for the host -i, --ip-address addresses for the hostname
Ref: http://linux.die.net/man/1/hostname
Example:
[ec2-user@terraform ~]$ hostname -I 10.10.10.10