-
-
Save nobro/14dc39b1193c82cf8de4 to your computer and use it in GitHub Desktop.
gps coordinates from gpspipe
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 | |
GPRMC="$(gpspipe -r -n 8 | grep GPRMC)" | |
STATUSGPS="$(echo "$GPRMC" | cut -d "," -f 3)" | |
COORDONATEN="$(echo "$GPRMC" | cut -d "," -f 4)" | |
COORDONATEE="$(echo "$GPRMC" | cut -d "," -f 6)" | |
if [ "$STATUSGPS" == "A" ];then | |
echo -n "$COORDONATEN"; echo -n " N "; echo -n "$COORDONATEE"; echo " E" | |
else echo "gps deconectat"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment