Subject: | |
From: | |
Reply To: | |
Date: | Thu, 12 Apr 2001 15:40:03 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
"Penney, John" wrote:
>
> Hello folks:
>
> This has stymied myself for a coupla hours so I figure that I need the
> wisdom of the 3000-l:
>
> In a Job I wish to perform a LISTF to a Temp file that I then use as input.
> I want to select out of this Temp file Session Numbers for passing to, say,
> an Abortjob command. Presently, I am attempting to restream the output of
> the LISTF to an INPUT command using the backreference "<".
>
> The challenge seems to be that I am only getting the first occurrence (i.e.
> first record) of the LISTF. So, not a help if I have say a half-dozen
> sessions I want to get off the system at a given time.
>
> Yes, there are better ways of doing this thing, so:
>
> 1) a better way to do this is welcome, and
>
> 2) why does this approach through the INPUT JOBNAM < INPFIL construct
> where INPFIL is the TEMP file from LISTF, not function?
>
> I placed the INPUT in a WHILE loop which loops forever(!).
It's not entirely clear to me what you're trying to accomplish, but seeing as
how I've spent most of today doing awk stuff, I'll take a shot and give a POSIX
method for doing it:
callci listfile ci.pub.sys,8 |\
awk '/^#/ { print $1 }' |\
xargs -i% echo callci abortjob \'%\'
The first statement executes the listfile command and pipes the output into the
second statement.
The second statement reads the listfile output, and for each line that begins
with # pipes the first token into the third statement.
The third statement reads the awk output and executes a command string after
replacing % with the value read from the pipe.
I'm doing "echo callci" just to demonstrate the results without actually
aborting anybody. Remove the echo if you want to actually abort things.
--
[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 *
|
|
|