dms_val="" function dms() { d=`echo $1 | sed 's/\..*$//'` r=`echo $1 | sed 's/^.*\././'` r=`echo 0$r '*' 60 | bc` m=`echo $r | sed 's/\..*$//'` r=`echo $r | sed 's/^.*\././'` r=`echo '(' 0$r '*' 60 ')' + 0.5 | bc` s=`echo $r | sed 's/\..*$//'` [ -z "$deg" ] && deg="0" [ -z "$m" ] && m="0" [ -z "$s" ] && s="0" dms_val="$d° $m’ $s"" } # Main if [ -r GoogleEarth.kmz ] then #b=`zcat GoogleEarth.kmz | grep coordinates | tail -1 | sed 's=,0=='` b=`zcat GoogleEarth.kmz | grep coordinates | tail -1 | sed 's=,[0-9.-]*=='` dlong=`echo "$b" | sed 's=,.*$=='` dlat=`echo "$b" | sed 's=^.*,=='` echo "Latitude $dlat, Longitude $dlong" > Coordinates.html dms $dlong slong=$dms_val dms $dlat slat=$dms_val echo "
Latitude $slat, Longitude $slong

" >> Coordinates.html chmod +w Coordinates.html D=`basename $PWD` D=`echo $D | tr "'_-" " ,"` cat << EOF > GoogleEarth.html Google Map - $D

If no imagery available, drag slider down a few notches, OR try selecting pure Map or Satellite view. EOF fi