#!/bin/bash # $HeadURL: https://svn.pasta.freemyip.com/main/miniade/trunk/bin/nop-sh $ $LastChangedRevision: 10133 $ # Modules . $(miniade) || { echo "${0##*/}: ERROR: miniade failed (hint: run 'miniade' to see error)" >&2; exit 1; } # Configurable stuff # Other globals main() { local MY_ARGS PROGNAME # Defaults for options # Process options miniade_process_options MY_ARGS "$@" && set -- "${MY_ARGS[@]}" miniade_get_progname PROGNAME # Process arguments [ $# = 0 ] || usage # Sanity checks and derivations # Guts { echo "" echo "" } > $PROGNAME.gpx while read -p "Description: " DESC; do read -p "Coordinates from Google Maps: " COORDS [[ $COORDS =~ ^\ *([0-9.]+)\ *,\ *([0-9.]+)\ *$ ]] || miniade_error "$COORDS: can't parse coordinates" LAT=${BASH_REMATCH[2]} LON=${BASH_REMATCH[1]} { echo " " echo " $DESC" echo " " } >> $PROGNAME.gpx echo done { echo "" } >> $PROGNAME.gpx echo } main "$@"