#!/bin/csh
#                        ----------
# -----------------------  chname  ---------------------
#                        ----------
#
#
     if ( $#argv != 7 ) then
          echo ''
          echo '    ---------'
          echo '    changes the name of a sequence of frames'
          echo '    ---------'
          echo ''
          echo '    Usage: chname <inname> <start> <end> <step> <outname> <start> <step> <extension>'
          echo ''
          exit 0
          endif

     @ icount = $2
     @ ocount = $6
     while ( $icount <= $3 )
        if ( -e  $1.$icount.$8 ) then
           echo renaming...$1.$icount $5.$ocount
           mv $1.$icount.$8 $5.$ocount.$8
        else
           echo "cannot find $1.$icount"
        endif  
     @ icount += $4    
     @ ocount += $7    
     end
     beep
     echo Done.
