#!/bin/sh PLAN=${HOME}/data/.planlf if [ ! -p $HOME/.plan ]; then echo .plan is not a pipe. Do mkfifo .plan exit 0 fi if [ ! -f $PLAN ]; then echo $PLAN does not exist. Create it it first. Ex : touch $PLAN exit 0 fi finsub () { cat $PLAN # channel file into pipe usr=`ps -elf | grep $USER | grep finger | grep -v "grep finger" | cut -c5-14` echo $usr >> $HOME/data/.planlog echo Hey, stop fingering me $usr, let me finger you instead: finger $usr } if [ -f $HOME/data/.planpid ]; then kill -9 `cat $HOME/data/.planpid` 2> /dev/null > /dev/null fi echo $$ > $HOME/data/.planpid while [ true ]; do trap "" 13 finsub > $HOME/.plan done