• Hi, good job! I look on https://ipinfo.io and if you try curl https://ipinfo.io/$IP/geo you get JSON data back. Therefore you can try use jq and try somthing like this ARR1=($(curl -s https://ipinfo.io/ | jq '.[]')); CITY="${ARR1[1]//\"/}" etc

  • or

    eval declare -A example=($(curl -s https://ipinfo.io/ | jq -r '. | to_entries[] | "[\"\(.key)\"]=\"\(.value)\""'))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment