---------- agent.sh --------------
#! /bin/sh
############################################
# UNIX Shell Agents
# by Siddharth Uppal
# agent.sh: Simple Shell Agent sample
############################################
AgentSource="/u/uppals/PlayGround/agent.sh"
NextHost="some.host.com"
echo "I'm currently running at `hostname`"
if [ "`hostname`" != "$NextHost" ]
then
echo "Moving to $NextHost"
rsh $NextHost $AgentSource
else
# We're on NextHost, do something!
echo "Displaying the users logged into $NextHost"
who
fi