3 # Quick script to convert the given file and upload load it to an attached GPS device
4 # As this modifies the given file, it is ideally designed for temporary files.
10 echo "Need a file to process"
14 if [ ! -e "$1" ]; then
15 echo "Specified file >$1< does not exist"
19 # Delete lines with track segments - there is no equivalent in routes
20 # Then simply replace track and trackpoints with route types
24 -e 's:<trkpt:<rtept:g' \
25 -e 's:</trkpt>:</rtept>:g' \
26 -e 's:<trk>:<rte>:g' \
27 -e 's:</trk>:</rte>:g' \
30 # Ths is obviously setup for a USB Garmin device
31 gpsbabel -r -i gpx,gpxver=1.1 -f "$1" -o garmin -F /dev/ttyUSB0
32 # One may need to change this for your configuration