#!/bin/csh -f
#   usage:  gaussian03 InputFile [OutputFile]
# 
setenv g03root /usr/local
setenv GAUSS_SCRDIR $cwd
source $g03root/g03/bsd/g03.login
if ($#argv == 0 ) then
        echo "Usage: gaussian03 <input file>"
        echo "   or  gaussian03 <input file> <output file>"
else 
        if ($#argv == 1 ) then
         set fname = `echo $1 | sed -e "s/.*\///g" | sed -e 's/\.[^.]*$//'`
         set output = $fname.log
        else
         set output = $2
         set fname = `echo $2 | sed -e "s/.*\///g" | sed -e 's/\.[^.]*$//'`
        endif
        cat $1 | $g03root/g03/g03 | tee $output
        if ( -e Test.FChk ) mv Test.FChk $fname.fch
endif
