3 #=======================================================================
5 # Read GPS data from stdin or file names at the command line and send a
6 # PostgreSQL table to stdout. Needs a database called "tmpgps" with the
8 #=======================================================================
10 cat "$@" | gpst
-o pgtab | psql
-c "TRUNCATE logg; COPY logg FROM stdin;" tmpgps
>/dev
/null
2>&1
11 cd ~
/bin
/src
/gpstools
/postgres
12 psql
-f "$HOME/bin/src/gpstools/postgres/allupdate.sql" tmpgps
>/dev
/null
2>&1
13 psql
-f "$HOME/bin/src/gpstools/postgres/distupdate.sql" tmpgps
>/dev
/null
2>&1
14 psql
-c "SELECT date as date, coor, sted, dist FROM logg ORDER BY date;" tmpgps