One thought on “Bash function for getting local IP on OSX”

  1. The function, as written, failed to return the IP address of my MBP running OS X 10.9.1. After poking around a bit, I was able to modify the function to work. Also, rather than inserting the snippet into .profile, I added it to .bash_profile. This is working for me:

    function ip {
    ifconfig en0

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>