#!/bin/ksh #################################################################### # qstat.sh - watch lawson application compiles run # J. David Schronce #################################################################### SLEEPTIME=5 # Seconds to sleep between checks DISPLAYERRORS=10 # Number of error files to display #################################################################### pl=$1 while true do clear if [ "X$1" = "X" ]; then pl=`qstatus | grep "On local" | head -1 | awk '{print $6}'` fi echo "Currently compiling in productline: $pl" cd $LAWDIR/$pl pwd echo; #if [[ `ls -l ??src/*.err | wc -l` -lt ${DISPLAYERRORS} ]]; then # ls -l ??src/*.err 2> /dev/null #else # echo "Too many errors to display." # echo "Use cd `pwd`;ls */*.err to see error files" echo "Last $DISPLAYERRORS errors.." ls -lrt ??src/*.err | tail -$DISPLAYERRORS 2> /dev/null #fi echo; echo Total number of error files; ls -l ??src/*.err|wc -l echo; if [ `qstatus | grep "On local" | wc -l` -eq 0 ];then date exit fi qstatus | grep "On local" echo; uptime echo; echo "Last job(s) entered into the QUEUE." qstatus | tail -2 sleep ${SLEEPTIME} done