#!/bin/sh
# script to start a set of programs on a set of machines (one each)
# takes as input a port number to use and a file containing machine - program
# pairs 
echo $1 | \
awk '{if (NR==1)
	{
         $APORT=$1
	}
        else
	{
         printf("rsh %s %s -d -p %s &\n",$1,$2,$APORT)
	 printf("echo starting %s on %s with port %s\n",$2,$1,$APORT)
	}
     }' - $2 | /bin/sh
