#!/bin/csh -f # Compare two files. If they differ, offer to move one to the other, # else offer to delete the first. if (! -e $1:q) then beep "Error: $1:q does not exist" exit 1 endif if (! -e $2:q) then beep "Error: $2:q does not exist" exit 1 endif if (-d $2:q && ! -e $2:q/$1:q) then beep "Error: $2:q/$1:q does not exist" exit 1 endif diff -s $1:q $2:q if ($status) then mv -i -v $1:q $2:q else rm -i -v $1:q endif