#! /usr/bin/zsh -f

# Crea le pagine HTML,

## hostname = linux1 
if [ -x /usr/local/pgsql/bin/psql ]
then
PSQL=/usr/local/pgsql/bin/psql
else
PSQL=psql
fi

#PGHOST=linux6
format=tuples_only
DB=maruska



for dir in video_?? video_?
do
table=${dir}_table
${PSQL}  -P ${format} -q -f $dir/query.sql  ${DB} > $table
cat $dir/head.html $table  $dir/tail.html > ${dir}.html
rm -v $table
done
# ho tolto  -h $(PGHOST)