#!/bin/csh -f 

set head=$1
set start=$2
shift ; shift
set index=$start

foreach i ( $* )
   set extention = `echo $i | sed 's/.*\(\..*\)/\1/'`
   set ind = `echo 000$index | sed 's/.*\(...\)$/\1/'`
   mv $i $head\_$ind$extention
   @ index = $index + 1
end

