#!/bin/csh -f # # myprog10 - script to backup multiple files # if ($#argv < 1) then echo -n "What do you want to copy " set tocopy = $< set tocopy = ($tocopy) else set tocopy = ($argv) endif set when = `date` foreach fyle($tocopy) echo "------------------ $fyle --------------" if (! -r $fyle) then echo "Unable to read (might not exist)" continue endif if (! -f $fyle) then echo "Not copied - is not a plain file" continue endif if (! -w ~/logback) then echo "Not able to write to output directory" echo $0 COMMAND ABORTED break endif cp $fyle ~/logback set stats = `wc $fyle` echo "$when : $stats[3] bytes" end