Subject: | |
From: | |
Reply To: | Paveza, Gary |
Date: | Fri, 21 Sep 2001 14:22:51 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Rather than using I/O redirection like that to create a temporary file, why
not try something along the lines of the following? Not only does it
eliminate the $STDLIST, it does all the operations in memory.
if [ "$1" = "" ]
then
echo "Syntax: testjob.sh <jobname>"
exit 1
fi
callci "SETVAR JOBCOUNT JOBCNT('$1')"
JOBCOUNT=$(callci "SHOWVAR JOBCOUNT" | awk '{print $3}')
if [ $JOBCOUNT -gt 0 ]
then
echo "Job is running"
callci "SETVAR JOB_EXISTS 'y'"
else
echo "Job is not running"
callci "SETVAR JOB_EXISTS 'n'"
fi
-------------------------------------------------------------
Gary L. Paveza, Jr.
Production Support Analyst - Lead
(302) 761-3173 - voice
(877) 720-2970 - pager
-----Original Message-----
From: Carl McNamee [SMTP:[log in to unmask]]
Sent: Friday, September 21, 2001 2:01 PM
To: [log in to unmask]
Subject: [HP3000-L] callci and piping to a file
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 *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|