Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active December 16, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedir/5458755 to your computer and use it in GitHub Desktop.
Save fedir/5458755 to your computer and use it in GitHub Desktop.
Latitude and longitude parsing from string into variables #shell #geo
#!/bin/bash
LATLNG="(53.3096,-6.28396)"
LAT=$(echo "$LATLNG" | sed -e "s/(\(.*\),\(.*\))/\1/g" )
LON=$(echo "$LATLNG" | sed -e "s/(\(.*\),\(.*\))/\2/g")
echo "Lat : $LAT"
echo "Lng : $LON"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment