#!/bin/csh 

set n_frames = $1 

# Remove any lingering frames from prior runs

/bin/rm -f frame.* >& /dev/null

# Enter the loop to produce the still images.  It is necessary
# to name the first nine as frame.01, frame.02, etc.
 
set count=1 

while($count <= $n_frames) 
   echo "$count" | extract_frames > /dev/null
   gnuplot frames.plt 
   if ($count < 10) then 
      set number = "0$count" 
   else 
      set number = $count 
   endif 
   mv frame.gif frame.$number 
   @ count++ 
end