HP 3000 Manuals

MPE XL Command Input/Output Redirection [ COMMUNICATOR 3000/XL XL RELEASE 2.1 ] MPE/iX Communicators


COMMUNICATOR 3000/XL XL RELEASE 2.1

MPE XL Command Input/Output Redirection 

by Scott Cressler 
Commercial Systems Division 

PRODUCT OVERVIEW 

Command I/O Redirection (CIOR) is a new feature of the MPE XL Command
Interpreter (CI) with this release of MPE XL. CIOR allows the redirection
of the input and output of CI commands.  A CI command is a "built-in"
command (such as :SHOWOUT or :SHOWME), a command file, a user-defined
command (UDC), or a program.  CIOR allows the output of a CI command to
be sent to a file or the input of a CI command, which reads from the
terminal, to be taken from a file.

Have you ever wanted to capture the output of a program or command in a
file, or perhaps to mail the output to someone using HPDesk, to print it,
or to include it in a document?  CIOR makes these tasks simple.  The
output of any command can be easily redirected to a file.

CIOR adds to the programmability of the CI. For example, command files
and UDCs can be written to sequentially read through a file and process
each record.  This is accomplished using CIOR and the :INPUT command.
Each :INPUT executed from a command file or UDC whose input has been
redirected to a file will read the next record from that file.  The :ECHO
command, if executed from a command file or UDC whose output has been
redirected to a file, can be used to write records to that file.  These
techniques can be combined to create system management or program
development tools using the CI instead of a programming language.

PRODUCT FEATURES 

CIOR provides the following functionality:

 *  Writing the output of a command to a file.

 *  Redirecting the input of a command to a file.

 *  Appending the output of a command to a file.

There are two new MPE XL predefined CI variables that are related to
CIOR:

 *  HPSTDIN: Contains the file name of the file that input has been
    redirected, or "$STDIN" if input has not been redirected.

 *  HPSTDLIST: Contains the file name of the file that output has been
    redirected, or "$STDLIST" if output has not been redirected.

CIOR EXCEPTIONS 

CIOR is available on almost every command.  The only exceptions are the
:CALC, :COMMENT, :ELSEIF, :IF, :REMOTE, :SETVAR, :SETJCW, :TELL, :TELLOP,
:WARN or :WHILE commands.  Any attempts to use CIOR to redirect I/O on
these commands will be ignored by the CI.



MPE/iX Communicators