* /trunk/tests/ og de 28 *.t-filene under der
[gpstools.git] / gpslist
blob21e17196c0a6ba774e07d6ac83ab035756b0db35
1 #!/bin/bash
3 #=======================================================================
4 # $Id$
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
7 # usual tables.
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, avst FROM logg ORDER BY date;" tmpgps