![]() The relevant output of networksetup -listallhardwareports for my system is: Hardware Port: Wi-Fi If you just want to output the target device's IP Address to stdout, use the following example: $ ipconfig getifaddr $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/'))" Networksetup -listallhardwareports shows for you. I have a MacBook Pro that doesn't have a built-in Ethernet Port so in my examples I'll use Hardware Port: Wi-Fi since I tested this in both examples below and it worked, however you can change it to Hardware Port: Ethernet if that is what the output of ![]() There may be several different ways to accomplish what you're asking, however, I'll just throw this out there.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |