argv0=$0
fn usage {
- echo 'usage:' $argv0 '[-p] [-h host] [-u user] [-k keypattern] [-P patternfile] [-c cmd arg ...]' >[1=2]
+ echo 'usage:' $argv0 '[-u user] [-k keypattern] [-P patternfile] [-p] [-t timeout] [-h host] [-c cmd arg ...]' >[1=2]
exit 'usage'
}
if(test -d /mnt/term/mnt/cpunote) {
rfork e
mainproc=$apid
- exec cat </mnt/term/mnt/cpunote/data >/proc/$mainproc/notepg &
+ {cat; echo -n hangup} </mnt/term/mnt/cpunote/data >/proc/$mainproc/notepg &
noteproc=$apid
wait $mainproc
echo -n $status >/mnt/term/env/rstatus >[2]/dev/null
- echo -n kill >/proc/$noteproc/note
+ echo -n hangup >/proc/$noteproc/notepg
}
}
cmd=()
host='$cpu'
+if(~ $#cpu 1) host=$cpu
exportfs=/bin/exportfs
connect=/bin/rconnect
~ $#* 1 && usage
switch($1){
case -P; exportfs=($exportfs $1 $2)
- case -[uk]; connect=($connect $1 $2)
+ case -[ukt]; connect=($connect $1 $2)
case -h; host=$2
case -c; cmd=$*(2-); *=()
case *; usage
fn pvar {
while(! ~ $#* 0){
- ~ $#$1 0 || path=/dev/null builtin whatis $1
+ ~ $#$1 0 && echo $1'=()' ||
+ path=/dev/null builtin whatis $1
shift
}
}
-exec $connect $host <{dir=`{pwd} pvar dir cmd; builtin whatis server; echo server} client <[10=0] >[11=1] >[12=2]
+>/env/rscript {
+ dir=`{pwd} pvar dir cmd
+ builtin whatis server
+ echo server
+}
+exec $connect $host /env/rscript client <[10=0] >[11=1] >[12=2]