tests/Makefile: Show the output for all tests, don't use Genlog
[gpstools.git] / gpslist
blob109e859fef8fe86daeab8f15a6afe2761d3f6991
1 #!/bin/bash
3 #=======================================================================
4 # gpslist
5 # File ID: 9cf16956-fafa-11dd-9073-000475e441b9
6 # Read GPS data from stdin or file names at the command line and send a
7 # PostgreSQL table to stdout. Needs a database called "tmpgps" with the
8 # usual tables.
9 # License: GNU General Public License version 3 or later.
10 #=======================================================================
12 cat "$@" | gpst -o pgtab | \
13 psql -X -c "TRUNCATE logg; COPY logg (date, coor, ele, name, dist, description) FROM stdin;" tmpgps
14 cd ~/bin/src/gpstools/postgres
15 psql -X -f "$HOME/bin/src/gpstools/postgres/allupdate.sql" tmpgps >/dev/null 2>&1
16 psql -X -f "$HOME/bin/src/gpstools/postgres/distupdate.sql" tmpgps >/dev/null 2>&1
17 psql -X -c "SELECT date as date, coor, name, dist FROM logg ORDER BY date;" tmpgps