HP OpenVMS Systems

ask the wizard
Content starts here

Capturing command output?

» close window

The Question is:

Why isn't there a /output=<filename> option with the OpenVMS PRODUCT command?
I'd like to get a file of the results and print it out.  I have to match Patch
 installations on three servers and that would help.
Right now I know nothing better than set host/log=<filename> 0, issuing my
 command, then logging out.
As an aside why do I get all those non-printing characters that show up in such
 a log file when I EVE (edit) the file?  Characters like NL, CR, backward
 question marks followed by [ (left bracket)and another character or two.  They
 don't show up when I TY
PE the file.  Can I generate a set host/log= file and not get these characters?
Jim Jelke

The Answer is :

    PCSI has not been updated to provide the standard qualifier package.
    This includes /OUTPUT, /PAGE, /SINCE, and the other usual qualfiers,
    as appropriate to the command verb.
    The output from ANY command, or sequence of commands can be captured
    using the @ command.  Place the commands in a command procedure and
    execute it with /OUTPUT. For example:
    	$ @MY_COMMANDS/OUTPUT=tmp.out
    If you don't want to create a procedure, simply execute TT:, the
    terminal.   For example:
    	$ @tt:/output=tmp.out
    	_$ product show product
    	_$ show system
    	_$ Exit
    Note that the prompt is given a leading underscore (_) character
    while executing at the lower command level.  Please enter the
    control-Z or type EXIT to end the interactive procedure.
    Another mechanism for capturing output of arbitrary commands is the
    PIPE command. For example:
    	$ pipe prod show prod > tmp.out
    The Wizard cannot speculate as to why /OUTPUT wasn't implemented in
    the product command. It just wasn't.
    Please remember that the log produced by SET HOST is a log of the
    exact character stream for the session, so all line formatting,
    escape sequences, cursor positioning and other serial terminal
    protocol is necessarily included. You don't see them when you TYPE
    the file, because they are interpreted and acted on, exactly
    duplicating the appearance of the session on the current terminal.
    This is a very valuable feature of SET HOST/LOG as it allows an
    examination of the EXACT character sequences sent and received
    during the session.

answer written or last revised on ( 19-AUG-2002 )

» close window