#!/bin/csh -f # # installfile file directory # # rcsid $Header: /ufs/repository/magic/scripts/installfile,v 1.1 2000/10/20 18:40:41 tim Exp $ # if ($#argv != 2) then Usage: installfile file directory exit 1 endif set file=$argv[1] set direct=$argv[2] set fnew = ${direct}/${file} set fold = ${direct}/${file}.old if (-e ${fnew}) then rm -f ${fold} mv ${fnew} ${fold} if (-e ${fnew}) then echo "installfile : Failed to move file ${fnew} to ${fold}" exit 3 endif endif cp ${file} ${fnew} exit $status