我正在尝试使用 shell 中的 freegeoip 获取纬度和经度。当我尝试以下命令时:
$ curl -s --get http://freegeoip.net/json/74.201.113.118 | grep -Po '(?<="latitude":)[^,}]*'
$ curl -s --get http://freegeoip.net/json/74.201.113.118 | grep -Po '(?<="longitude":)[^,}]*'
我能够获得一些值,但是每当我用自己的 IP 地址替换 IP 地址时,该命令只会输出 0。知道为什么吗?