atat-mirror/safecp

28 lines
516 B
Plaintext
Raw Permalink Normal View History

2023-08-31 20:30:18 +02:00
#!/bin/csh
if ( "x$1" == "x" ) then
echo "Syntax: safecp file1 ... filen destdir"
exit 1
endif
if ( ! -d safecpdir ) then
mkdir safecpdir
endif
set dest=$argv[$#argv]
if ( ! -d $dest ) then
echo $dest does not exist
exit 1
endif
echo -n "" >! safecpdir/touninstall.txt
foreach src ( $* )
if ( "x$src" != "x$dest" ) then
if ( -e $dest/$src ) then
cp -f $dest/$src safecpdir/
endif
cp -f $src $dest
echo $dest/`echo $src | sed 's+.*/++g'` >> safecpdir/touninstall.txt
endif
end