#!/bin/sh
who | awk '{ split($5,idleTime, ":"

if (idleTime[2] >= 30)
printf("%s %s has been idle
for 30 minutes", $1, $3)
}' > idlers_file.$$
# to send message to their terminsl,do the following...
cat idlers_file.$$ | while read line
do
idlers=`awk '{print $1}'`
terminal=`awk '{print $3}'`
write $idler $terminal < idle_message.txt
done
This is very generic but is a start. I'm not sure that the field numbers from the who command are correct. I used $5 for the idle time and $3 for the terminal. May be different. (I'm not at a terminal).Might need to evaluate those fields for better accuracy. Hope this helps for what it's worth
