#! /bin/csh -f @ i = 3 @ k = 1 while ( $i < = 6 ) if ( $k < 10 ) then set num = 000$k else if ( $k < 100 ) then set num = 00$k else if ( $k < 1000 ) then set num = 0$k else @ num = $k endif foreach file ( `ls -1 0$i/*gif` ) cp $file 2010_movie/$num.gif @ k++ if ( $k < 10 ) then set num = 000$k else if ( $k < 100 ) then set num = 00$k else if ( $k < 1000 ) then set num = 0$k else @ num = $k endif end @ i++ end