DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T u

⟦7c6500b0a⟧ TextFile

    Length: 1342 (0x53e)
    Types: TextFile
    Names: »usr/lbin/restorefiles «

Derivation

└─⟦307897ef0⟧ Bits:30004042/core1.imd SW95705I 386/ix Multi-user Release 1.2
    └─⟦this⟧ »usr/lbin/restorefiles « 

TextFile

#ident	"@(#)sadmin:shell/restorefiles	1.2"
#	restore a file from the save area to the regular file systems

flags="-qq -k$$"
trap 'exit' 1 2  15

sfile=`checkre ${flags} -fe 'Enter full path name of file to be restored [q]:
	' \
	'.' ' ' \
	'^[^ ;	][^ ;	]*$' 'Blanks or tabs not permitted in the file name.' \
	'^/' 'A full path name must begin with "/".' \
	'[^/]$' 'No trailing "/" in the file name.' \
	'/[^/]\{1,14\}$' 'No more than 14 characters in a file name.'`
echo 'Enter path name of where restored file is to be placed or
press RETURN if restored file is to be put to its original place:\n\t\c'
read rfile
if [ -z "${rfile}" ]
then
	rfile=${sfile}
fi

trap 'exit 1' 1 2  15
trap "rm -f /tmp/$$restorefiles /tmp/$$Xrestorefiles" 0
(
	cd /save/list
	fgrep -x ${sfile} /dev/null */*  |  tail -1 >/tmp/$$restorefiles
)
if [ ! -s /tmp/$$restorefiles ]
then
	echo "File '${sfile}' not in save area."
	exit
fi
ed - /tmp/$$restorefiles <<-!
	t.
	s;^;cp '/save/files/;
	s;:;';
	s;$; /tmp/$$Xrestorefiles;
	-s/:.*//
	s;\(..\).\(..\).\(..\).\(.*\);echo Found '${sfile}' saved \4 \2/\3/\1.;
	w
	q
!
sh /tmp/$$restorefiles 2>/dev/null  ||
{
	echo >&2 "Unable to restore '${sfile}'.  Wrong permission."
	exit 1
}
if  mv /tmp/$$Xrestorefiles ${rfile}
then
	echo "'${sfile}' now restored as\\n'${rfile}'."
else
	echo "'${sfile}' not restored."
fi