Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Script which determinesif a location is north or south
- #of another location
- if [ "$#" -lt 1 ]
- then
- echo "input error"
- echo "usage: $0 <adderss>"
- echo "example usage: $0 '123 5th Ave S Naples FL'"
- exit 1
- fi
- #set station's Lat
- s="26.181617"
- #Get Call's Lat
- address=$1
- c="$(wget -O- -q "https://maps.googleapis.com/maps/api/geocode/json?address=$address"|\
- grep '"lat"'|head -n1|awk '{print $3}'|cut -d\, -f1)"
- #Determine
- if (( $(bc <<< "$s < $c") ));
- then
- echo "North";
- else
- echo "Greater";
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement