#!/bin/csh -f # # myprog11 - script to backup multiple files # if ($#argv < 1) then echo "No parameters given - no action taken" exit endif set tocopy = ($argv) set totsiz = 0 foreach fyle($tocopy) echo "------------------ $fyle --------------" 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 "Backed up ...... size $stats[3] bytes " @ totsiz = $totsiz + $stats[3] end echo "Total size of files backed up: $totsiz"