fig2tex は csh のscript file です。

#!/bin/csh
set ff=$1:r
if  ( -e $ff.fig ) then
set figfile=$ff.fig
else if  ( -e $ff.xfig ) then
set figfile=$ff.xfig
else
echo "No $ff.xfig or $ff.fig found."
exit
endif

nkf -u $figfile > $ff.fig2

fig2dev -L pstex $ff.fig2 /tmp/$ff.pstex2
fig2dev -L pstex_t $ff.fig2 /tmp/$ff.pstex_p2

nkf -j /tmp/$ff.pstex2 > /tmp/$ff.pstex
nkf -j /tmp/$ff.pstex_p2 > /tmp/$ff.pstex_p

echo "\begin{picture}(0,0)%" > /tmp/$ff.pstex_t
echo "\special{psfile=/tmp/"$ff".pstex}%" >> /tmp/$ff.pstex_t
echo "\end{picture}%" >> /tmp/$ff.pstex_t
cat /tmp/$ff.pstex_p >> /tmp/$ff.pstex_t

set tmpfile = /tmp/$ff.$$
echo "\documentstyle[12pt]{article}" >$tmpfile.tex
echo "\begin{document}">>$tmpfile.tex
echo "\pagestyle{empty}">>$tmpfile.tex
echo "%\enlargethispage*{10in}"  >> $tmpfile.tex
echo "\input{/tmp/$ff.pstex_t}" >> $tmpfile.tex
echo  "\end{document}">>$tmpfile.tex
echo "latex-ing file =>" $ff
/local/bin/jlatex $tmpfile 
##>/dev/null " $ff
/local/bin/dvi2ps $ff.dvi >! $ff.eps
echo "Finished: you can view file => ghostview " $ff.eps
rm $tmpfile.tex 
rm /tmp/$ff.pstex /tmp/$ff.pstex_p /tmp/$ff.pstex_t /tmp/$ff.pstex2 /tmp/$ff.pstex_p2 $ff.fig2
rm $ff.dvi $ff.aux $ff.log