HP3000-L Archives

September 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Fri, 21 Sep 2001 11:30:23 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (84 lines)
This fails because callci in batch appends some CI I/O redirection to your
command string in order to capture the output into a temporary file of its
own.  Therefore callci in batch will choke on :SETVAR and other commands that
don't allow CIOR, or commands where you are explicitly trying to do CIOR.

You have a number of workarounds:

1) :SHOWJOB supports directing the output to a file equation, which avoids the
need for CIOR:

:help showjob,all
SHOWJOB

     Displays the status information about jobs/sessions.  (CM)

SYNTAX

             [[#]Snnn          ]
             [[#]Jnnn          ]
     SHOWJOB [STATUS           ][;JOBQ][;*listfile]
             [SCHED            ]
             [item[;item[;...]]]

2) Instead of CIOR, use shell I/O redirection, i.e.:

callci "showjob job=@j" >/SYS/OPERATOR/joblist.txt

3) Hide the CIOR in a UDC or command file, i.e.

callci "myshowjob"

Where myshowjob is a UDC or command file that does:

showjob job=@j >/SYS/OPERATOR/joblist.txt

- Mark B.

Carl McNamee wrote:
>
> 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 *

--
[log in to unmask]
Remainder of .sig suppressed to conserve scarce California electrons...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2