[Info-vax] Command Procedure Pipe output to a variable

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Tue Aug 31 08:33:42 EDT 2021


In article <4c1134ed-01ff-471c-a6ec-187315595574n at googlegroups.com>, Jim <mckinneyj at leidos.com> writes:
>On Tuesday, August 31, 2021 at 5:49:46 AM UTC-4, HCorte wrote:
>> Implementing a command procedure that first obtains the device allocated to a process for example purposes called YYYYYY. 
>> 
>> How to output the results of (SEARCH SYS$INPUT "Devices allocated") to the variable DEVICEAUX tried (READ SYS$PIPE DEVICEAUX) but with no success. 
>> 
>> $ pipe SH PROCESS YYYYYY | SEARCH SYS$INPUT "Devices allocated" | (READ SYS$PIPE DEVICEAUX) 
>> $ WRITE SYS$OUTPUT DEVICEAUX 
>> $ DEVICE_AUX = F$EDIT(F$ELEMENT(1, ":", TEST),"TRIM") 
>> $ WRITE SYS$OUTPUT DEVICE_AUX 
>> 
>> can make it work to write to a file 
>> $ pipe SH PROCESS SCMLCOMOLM | SEARCH SYS$PIPE "Devices allocated" > DEVICEAUX.DAT 
>> 
>> but would prefer to avoid having to write and read from file if possible, also in command procedure should alls use SYS$PIPE instead of SYS$INPUT?
>
>
>Maybe pass the value of the SEARCH output back to the parent process using a job logical name...
>
>$ pipe/nosymbol/nological -
>    show process YYYYYY | -
>    search sys$pipe "Devices allocated:" | -
>    ( read sys$pipe x ; define/job x &x )
>$ device_aux = f$element(1,":",f$edit(f$trnlnm("x","lnm$job"),"collapse"))
>$ deassign/job x
>$ show symbol device_aux


Or.., get and install my SYMBOL utility, and then it's simply:

$ PIPE SH PROCESS SCMLCOMOLM | SEARCH SYS$PIPE "Devices allocated" | SYMBOL/SET/QUOTE DEVICEAUX

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.



More information about the Info-vax mailing list