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.
No need to do unportable ifconfig parsing in Bash. It's a trivial one-liner in Python:
python -c 'import socket; print(socket.gethostbyname(socket.gethostname()))'