[Info-vax] PIPE question / problem
Syltrem
syltremzulu at videotron.ca
Fri Jan 29 20:33:59 EST 2010
Hello
I'm trying to avoid using temporary files to capture the result of a
command, but somehow PIPE does something funny
I use the MRU utility. I've tried reproducing the problem with another
command but could not.
This example runs a SHOW command with bad parameters
$ deass /job ROBOT$STATUS
$ Pipe ( SHOW BAD PARAMETER ; Define/Job ROBOT$STATUS &$STATUS ) | (show log
ROBOT$STATUS)
"ROBOT$STATUS" = "%X00038060" (LNM$JOB_8D494B40)
It does set ROBOT$STATUS with the value of $STATUS correctly
This one is basically the same thing, with the MRU command
$ deass /job ROBOT$STATUS
$ Pipe ( ROBOT BAD PARAMETER ; Define/Job ROBOT$STATUS &$STATUS ) | (show
log ROBOT$STATUS)
%SHOW-S-NOTRAN, no translation for logical name ROBOT$STATUS
$
--> Why isn't the DEFINE of ROBOT$STATUS done properly ?
The way I try to capture the status may not be right, it's the 1st time I
try something like this.
Bear in mind that what I really want to do is this below, and is why I
really use a pipe. I want to retrieve both the $STATUS and the single-line
of
output from the MRU command execution, like this :
$ deass /job ROBOT$STATUS
$ deass /job ROBOT$RESPONSE
$ Pipe ( ROBOT FIND CART SCRAT1L4 ; Define/Job ROBOT$STATUS &$STATUS ) |
( Read SYS$INPUT rec ; rec=f$edit(rec,"compress") ; Define
/Job ROBOT$RESPONSE &Rec )
$ sh log ROBOT$STATUS
"ROBOT$STATUS" = "%X00000001" (LNM$JOB_8D494B40)
$ sh log ROBOT$RESPONSE
"ROBOT$RESPONSE" = "SLOT: 0 SCRAT1L4" (LNM$JOB_8D494B40)
$
But when the result is not successful the ROBOT$STATUS is never returned.
Example with bad parameters in the MRU command :
$ deass /job ROBOT$STATUS
$ deass /job ROBOT$RESPONSE
$ Pipe ( ROBOT BAD COMMAND ; Define/Job ROBOT$STATUS &$STATUS ) | (Read
SYS$INPUT rec ; define/job ROBOT$RESPONSE &rec ; show symbol rec ; show log
ROBOT$STATUS ; show log ROBOT$RESPONSE)
REC = "The BAD command is not supported."
%SHOW-S-NOTRAN, no translation for logical name ROBOT$STATUS
"ROBOT$RESPONSE" = "The BAD command is not supported." (LNM$JOB_8D494B40)
$
Only when I use correct parameters to the MRU command, are $STATUS and the
output
correctly returned.
This seems to work when the result of the MRU command is successful, but it
does not when it exits with an error. Other commands still work even when
terminating in error. Even though this DELETE command returns with an error,
the $STATUS is
returned :
$ deass /job ROBOT$STATUS
$ deass /job ROBOT$RESPONSE
$ pipe ( del popo ; Define/Job ROBOT$STATUS &$STATUS ) | (Read SYS$INPUT rec
; define/job ROBOT$RESPONSE &rec ; show symbol rec ; sh
ow log ROBOT$STATUS ; show log ROBOT$RESPONSE)
REC = "%DELETE-E-DELVER, explicit version number or wild card required"
"ROBOT$STATUS" = "%X1093120A" (LNM$JOB_8D494B40)
"ROBOT$RESPONSE" = "%DELETE-E-DELVER, explicit version number or wild
card required" (LNM$JOB_8D494B40)
If anyone has a better way to achieve this with PIPE, or can explain the
behavior, I'd be happy to hear it.
It may be that VMS is completely fucked up, as I've seen it work once or
twice as you can see here :
$ deass /job ROBOT$STATUS
$ deass /job ROBOT$RESPONSE
$ Pipe ( set noon ; ROBOT FIND CART CLNU0 ; Define/Job ROBOT$STATUS
&$STATUS ) | (Read SYS$INPUT rec ; define/job ROBOT$RESPONSE &r
ec ; show symbol rec ; show log ROBOT$STATUS ; show log ROBOT$RESPONSE)
REC = "FIND failed on $2$GGA0:: Cartridge not found."
%SHOW-S-NOTRAN, no translation for logical name ROBOT$STATUS
"ROBOT$RESPONSE" = "FIND failed on $2$GGA0:: Cartridge not found."
(LNM$JOB_8D494B40)
$ sh log ROBOT$STATUS
"ROBOT$STATUS" = "%X07608262" (LNM$JOB_8D494B40)
--> Note that the SH LOG ROBOT$STATUS in the PIPE command says it does not
exist, but when I did it right after that, it says it's there.
Completely dumb. Or I definitely don't see something obvious.
Thanks !
Syltrem
More information about the Info-vax
mailing list