|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: T u
Length: 1612 (0x64c)
Types: TextFile
Names: »uuto«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./usr/bin/uuto«
#!/bin/sh
#$Header: uuto.sh,v 1.4 86/09/24 09:12:43 dce Exp $
PATH=/usr/ucb:/bin:/usr/bin
export PATH
Myname=`basename "$0"`
a=""
f=""
d=""
sub=""
export UUP
mysys=`uuname -l`
mesg="Usage: $Myname [-m -p] files remote!user"
if test $# -lt 1
then
echo $mesg
exit 1
fi
trap "exit 1" 1 2 13 15
copy=0
# get options
while true
do
case $1 in
-m) a="$a $1" sub="$sub -m" ;;
-p) copy=1 sub="$sub -p" ;;
-*) echo $mesg; exit 1;;
*) break ;;
esac
shift
done
# be sure have both files and destination
if test $# -eq 1
then
echo $mesg
exit 2
fi
# get file names
while test $# -gt 1
do
if test -d "$1" -a {"$1" = "." -o "$1" = ".."}
then shift; continue
elif test -r "$1" -a -f "$1"
then f="$f $1"
elif test -r "$1" -a -d "$1"
then d="$d $1"
elif test "$UUP" = ""
then echo "$1: file/directory not found"; exit 1
fi
shift
done
# the recipient arg: remote!user
# remote may be omitted (default is this machine)
# must have at least !user
remote=`expr $1 : '\(.*\)!'`
user=`expr $1 : '.*!\(.*\)'`
if test -z "$user"
then
echo "$Myname: incomplete destination -- must specify user"
echo "$mesg"
exit 2
fi
if test 1 -eq "$copy"
then a="$a -C"
fi
a="$a -d -n$user"
error=1
if test -n "$d" -a -n "$user"
then
for i in $d
do
( cd $i; UUP="$UUP/$i"
for j in `ls -a`
do
if test "$j" = "." -o "$j" = ".."; then continue;
else
FILES="$FILES $j"
fi
done
if test "$FILES"; then
uuto $sub $FILES $1;fi)
error=0
done
fi
if test -n "$f" -a -n "$user"
then
uucp $a $f $remote!~/receive/$user/$mysys$UUP/
error=0
fi
if test $error = 1
then
echo $mesg
exit 2
fi
exit 0