A walkthrough for building a cross-platform `myip` shell script that retrieves both local and public IP addresses from the command line. For the public IP, it uses `curl` against ifconfig.me with flags for reliability. For the local IP on Linux, it uses `ip route get 1.1.1.1` with a Perl regex to extract the source address
Sort: