#! /bin/sh
#
# syntax:
#	save file.c
#
# Quick hack to relinquish control on lots of files without losing the work.
# 	o saves the file to /tmp/file.c.save
#	o unco's the file
#	o removes the resulting link
#	o moves /tmp/file.c.save back to file.c
#
for file do
    echo "\cp $file /tmp/$file.save"
    \cp $file /tmp/$file.save
    echo "unco $file"
    unco $file | grep -s "You do not have"
    if test $? -eq 0 ; then
	echo "$file will not be replaced by local copy"
	\rm -f /tmp/$file.save
	continue
    fi
    echo "\rm $file"
    \rm -f $file
    echo "\mv /tmp/$file.save $file"
    \mv /tmp/$file.save $file
done
