#! /bin/csh -f
# Make a set of pxl files.

# Get the list of possible files.
if (-d gf && -d pxl) then
   cd gf
   set font_list=`/bin/ls *gf`
cd ..
else
   echo 'No subdirectories gf and pxl.'
   exit(1)
endif

# Has this already been run?
set out_file = make_pxl_files
if (-e $out_file) then
   echo "The script $out_file already exists."
   exit(2)
endif

# Before all the font-generating, need:
echo '#! /bin/csh -f' >> $out_file
echo 'cd gf' >> $out_file

foreach font ($font_list)
   if ($font =~ *[0-9]gf) then
         echo "gftopxl $font" >> $out_file
         echo "/bin/mv $font:r*pxl ../pxl" >> $out_file
   endif
end

# Make it executable.
chmod +x $out_file
