#!/bin/csh -f

# this shell script auto-generates an eps file from the *.vals file

set fname=`echo $1 | awk 'BEGIN{FS="."}{print $1}'`

set psname=$fname.pstex
set epsname=$fname.eps
set vname=$fname.vals
set gname=$fname.gnu.en
set bindir=${HOME}/bin
set scriptdir=$bindir/.scripts/
set awk_script="gnu_gen.awk"
set gnu_script="blank.gnu"


awk -v gpsname="$psname" -v gvname="$vname" -f $scriptdir$awk_script $scriptdir$gnu_script > $gname

gnuplot $gname

# generate eps file from pstex
$bindir/pstex2eps $psname

# fix the bounding box
$bindir/fixbb $epsname