#!/bin/bash

while [ 1 ] ; do
    echo ""
    echo "----"
    echo "Scanning for gcc|g++|javac processes"
    echo "----"
    ps auxww | egrep 'gcc|javac|g++'
    echo "===="
    echo ""
    echo "sleeping for 5 secs ..."
    echo "[ press <enter> to re-sample processes earlier; and 'q' or ^C to quit]"
    read -t 5 keyboard_entry
    if [ $? = 0 ] ; then
	if [ "x$keyboard_entry" = "xq" ] ; then
	    exit 0
	fi
    fi
    echo "... done"
done
