#!/bin/sh

if [ "$1" = "" ] ; then
  FILES=*.in
else
  FILES=$@
fi

DIR=../..
PATH=$DIR:$PATH
GDFONTPATH=$DIR; export GDFONTPATH

for FILE in $FILES ; do
  echo $FILE

  shcnox < $FILE > shc.out
  gnuplot shc_eps.plt
  patch shc_eps.eps shc_eps.diff
  
  TMP=`echo $FILE | awk 'BEGIN{FS=".";}{s=$1; for(i=2;i<=NF-1;i++){s=s "." $i;} print s;}'`
  cp shc_eps.eps $TMP.eps
done

./rmtmp.sh

