#!/usr/local/bin/perl5 -w #shell script takes all the files in a directory #it renames them by prepending new to the name of the file #it moves them to the specified directory #script is not interactive, directory to open and to move to must #be specified #open directory opendir(MAIN, "/Net/cub/Users/ttest/www/study_collections/korea/wake") || die "no such directory:$!"; #read from it @name = readdir(MAIN); close(MAIN); #loop through the array containing all the file names foreach $name(@name) { $oldname = $name; $name =~ s/wi/Wi/; #system calls for copying and moving files system("cp $oldname $name"); }