How to output city by IP address to stdout?

I have a list of IP addresses in the ip.txt file (there are a lot of them). I used ipinfo.io services to search data by IP and sed to cut out only the city. #!/bin/bash while IFS= read -r ip; do curl ipinfo.io/$ip >> test.txt sed -i ‘/city/!d’ test.txt cat /dev/null > test.txt done <… Read More How to output city by IP address to stdout?