HPlogo Using NS 3000/iX Network Services: HP 3000 MPE/iX Computer Systems > Chapter 8 NetCI

Scripting and Logging

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NetCI redirects both input and output when scripting and logging are used simultaneously. When output is redirected, remember the following:

  1. During execution of the script file, the output mode specified in the script file is always in effect. If the script file does not specify an output mode, the mode prior to script file execution remains in effect.

  2. After execution of the script file, the output mode prior to execution takes effect again.

Input and output determine the operational mode in effect. It is only in the logging operation mode that output is to both the screen and log file. Refer to Table 8-2 “Operation Modes” to determine the input and output applicable to each mode of operation.

Table 8-2 Operation Modes

Operation ModeInputOutput
 KeyboardScript FileScreenLog File
Scripting XX 
LoggingX XX
Scripting & Logging X X
Interactive
(No Logging and Scripting)
X X 

 

Examples

The following examples begin and end with the interactive operation mode. Each example shows the operation and output mode in effect at a particular time. The output can be redirected to either the screen or a log file, or to both the screen and log file. The straight line under Output Mode in each example indicates when and how long the output is redirected to the screen, log file, or both. Notice from the examples that the scripting operation mode is always in effect whenever a script file is executing. However, logging mode may not always be in effect.

Example 1

Figure 8-6 “Scripting and Logging Activated (Example 1)” shows both scripting and logging being activated. Before execution of the script file, output is to the screen. When you execute the script file with PLAY, the script file redirects output to FILE1. After execution, output returns to the screen since this is the output mode prior to execution. You do not need to specify the LOGRESET command.

Figure 8-6 Scripting and Logging Activated (Example 1)

[Scripting and Logging Activated (Example 1)]

Example 2

Figure 8-7 “Scripting and Logging Activated (Example 2)” first shows logging being activated by input from the keyboard. Output is to the screen and to a log file called FILE1. Since you may need to interactively respond to the output, it will also be displayed to the screen. Next, you execute a script file called SCRIPT1 with PLAY. While the script file is executing, input is from the script file and output continues to FILE1 since the script file has not redirected the output. The output continues to FILE1 since the user is not required to interactively respond during execution. The LOGRESET command then resets the output to the screen. If LOGRESET is not specified, output will continue to the screen and to FILE1 since the output modes prior to script file execution take effect.

Figure 8-7 Scripting and Logging Activated (Example 2)

[Scripting and Logging Activated (Example 2)]

Example 3

Figure 8-8 “Scripting and Logging Activated (Example 3)” first shows logging being activated by input from the keyboard. Output is to the screen and to a log file called FILE1. Since you may need to interactively respond to the output, it will also be displayed to the screen. Next, you execute a script file called SCRIPT1 with PLAY. While the script file is executing, input is from the script file and output is to FILE1. After script file execution, output returns to the screen and to FILE1 which are the output modes prior to execution. At this point, onlylogging is in effect. Output continues to the screen and to FILE1 until LOGRESET where output is only to the screen.

Figure 8-8 Scripting and Logging Activated (Example 3)

[Scripting and Logging Activated (Example 3)]

Example 4

Figure 8-9 “Scripting and Logging Activated (Example 4)” first shows logging being activated by input from the keyboard. Output is to the screen and to a log file called FILE1. Since you may need to interactively respond to the output, it will also be displayed to the screen. Next, you execute a script file called SCRIPT1 with PLAY. While the script file is executing, input is from the script file and output continues to FILE1 until the output is redirected to FILE2 with % LOG FILE2. After script file execution, output returns to the screen and to FILE1 which are the output modes prior to execution. At this point, only logging is in effect. Output continues to the screen and to FILE1 until LOGRESET where output is only to the screen.

Figure 8-9 Scripting and Logging Activated (Example 4)

[Scripting and Logging Activated (Example 4)]