I have a shell script which works wonderfully at the command line but
doesn't work correct in a batch job.
if [ -f /SYS/OPERATOR/joblist.txt ] ; then
rm /SYS/OPERATOR/joblist.txt
fi
callci "SHOWJOB JOB=@J > /SYS/OPERATOR/joblist.txt"
callci "SAVE /SYS/OPERATOR/joblist.txt"
grep "$1" /SYS/OPERATOR/joblist.txt
export grep_status=$?
rm /SYS/OPERATOR/joblist.txt
if [ $grep_status = 0 ] ; then
callci "SETVAR JOB_EXISTS 'y'"
echo Job running.
else
callci "SETVAR JOB_EXISTS 'n'"
echo Job not running.
fi
When run from the command line the command (callci "SHOJOB JOB=@J >
/SYS/OPERATOR/joblist.txt") pipes the output of showjob to the temporary
file. However when run in batch the showjob output is sent to $STDLIST
instead of the temporary file. I execute the script by typing "SH -c
/SYS/OPERATOR/JOBCHK parm1" where parm1 one is the jobname that I want to
look for. I also tried "RUN SH.HPBIN.SYS;INFO="/SYS/OPERATOR/JOBCHK parm1"
with the same results.
Thoughts? Comments? Criticism?
Carl McNamee
Systems Administrator
Billing Concepts
(210) 949-7282
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *