//View Tip #872
» Vi mode in bash
» Truncated $PWD in the command prompt
» Scripting Lynx for automated web actions
» Change prompt color dynamically
Similar Tips
» Disable bash history» Vi mode in bash
» Truncated $PWD in the command prompt
» Scripting Lynx for automated web actions
» Change prompt color dynamically

Latest tips by RSS
Click here to subscribe

Follow Shell-Fu on Twitter
Click here to follow

Follow Shell-Fu on identi.ca
Click here to follow
The following bash script, which depends on lynx web browser, uses Google's reverse geocode service to find a nearby address given a latitude and longitude pair:
#!/bin/bash # findnearest # Usage: findnearest latitude longitude # Ex. findnearest 17.976227 -66.111016 lat=$1 long=$2 result=$(lynx -dump "http://maps.google.com/maps/geo?output=csv&oe=utf-8&ll=$lat,$long") echo $result | cut -f3- -d,
#!/bin/bash
# findnearest
# Usage: findnearest latitude longitude
# Ex. findnearest 17.976227 -66.111016
lat=$1
long=$2
wget -q "http://maps.google.com/maps/ge … f-8&ll=$lat,$long" -O -|cut -f3- -d,