#!/bin/sh
# Change the following four lines to the names/addresses of your PCs
export PE3=lecar
export PE2=samurai
export PE1=fiesta
export PE0=corvair
# 1995 by Hank Dietz and Tim Mattox
export RUNDIR=`pwd`
trap '$RUNDIR/killrsh
echo -n "
Resetting PAPERS..."
rsh $PE3 "cd $RUNDIR
. T
export PAPERS_IPROC=3
cold </dev/null >/dev/null 2>/dev/null" </dev/null
echo -n " PE3"
rsh $PE2 "cd $RUNDIR
. T
export PAPERS_IPROC=2
cold </dev/null >/dev/null 2>/dev/null" </dev/null
echo -n " PE2"
rsh $PE1 "cd $RUNDIR
. T
export PAPERS_IPROC=1
cold </dev/null >/dev/null 2>/dev/null" </dev/null
echo -n " PE1"
cd $RUNDIR
. T
cold </dev/null >/dev/null 2>/dev/null
echo " PE0."' 2
rsh $PE3 "cd $RUNDIR
. T
export PAPERS_IPROC=3
$@ </dev/null >/dev/null" </dev/null &
rsh $PE2 "cd $RUNDIR
. T
export PAPERS_IPROC=2
$@ </dev/null >/dev/null" </dev/null &
rsh $PE1 "cd $RUNDIR
. T
export PAPERS_IPROC=1
$@ </dev/null >/dev/null" </dev/null &
cd $RUNDIR
. T
$@
echo -n "PE0 has finished, Resetting PAPERS..."
$RUNDIR/killrsh
sleep 1
rsh $PE3 "cd $RUNDIR
. T
export PAPERS_IPROC=3
cold </dev/null >/dev/null 2>/dev/null" </dev/null
echo -n " PE3"
rsh $PE2 "cd $RUNDIR
. T
export PAPERS_IPROC=2
cold </dev/null >/dev/null 2>/dev/null" </dev/null
echo -n " PE2"
rsh $PE1 "cd $RUNDIR
. T
export PAPERS_IPROC=1
cold </dev/null >/dev/null 2>/dev/null" </dev/null
echo -n " PE1"
cd $RUNDIR
. T
cold </dev/null >/dev/null 2>/dev/null
echo " PE0."
