Created
January 17, 2011 23:33
-
-
Save cnlpete/783700 to your computer and use it in GitHub Desktop.
rgm-get ... used for getting info from my device and reading nmea and gpx simultaniously .... also supports reading ranges (17-22)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEVICE=/dev/ttyUSB0 | |
NUMBER=$1 | |
VAR=`echo $NUMBER | grep -o - | wc -l` | |
if [ "$VAR" == "1" ] | |
then | |
#list | |
POS=`expr index "$NUMBER" -` | |
FIRST=${NUMBER:0:$POS-1} | |
REST=${NUMBER:$POS} | |
else | |
#no list | |
FIRST=$NUMBER | |
REST=$NUMBER | |
fi | |
echo "from $FIRST to $REST do..." | |
i=$FIRST | |
while [ $i -le $REST ] | |
do | |
echo $i | |
NAME=`rgm3800-rev25.py -d $DEVICE list $i | grep -o ....-..-..` | |
FILE=$NAME-$i | |
rgm3800-rev25.py -d $DEVICE track $i > $FILE.nmea | |
rgm3800-rev25.py -d $DEVICE trackx $i > $FILE.gpx | |
i=$(( $i + 1 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment