![]() |
![]() |
|
|
![]() |
![]() |
Using NS 3000/iX Network Services: HP 3000 MPE/iX Computer Systems > Chapter 8 NetCI![]() Writing and Executing Script Files |
|
A script file includes all commands, flow control statements, and data that allow you to remotely access and perform operations on nodes. To execute the script file, it must reside on the management node on which NetCI is installed. You can create a script file with any text editor while you are at the MPE colon prompt or from within NetCI. If you are in NetCI, you need to run the editor program from the management node. For example, you enter
to run the editor on node K which is the management node. Make sure the editor program resides on the management node, and the user associated with the session is allowed access to the editor. The script file you created will then reside on the management node in the session's user account/group that was specified in NetCI configuration. In this example, the new script file will reside on management node K in the operator.sys account. When you create a script file, remember the following:
In the PLAY command, the first parameter specified after the file name is considered as position 1. If you specify !1 within your script file, NetCI will substitute the first parms value or string for !1. The file name is considered as position 0. There are also reserved characters that you can use in the script file. Whenever the reserved character is encountered, NetCI substitutes it with specific data as shown in Table 8-1 “Reserved Characters”. NetCI does not refer to the PLAY command for a parms value or string. For example, when the script file contains !a, NetCI substitutes the current account name for !a. Table 8-1 Reserved Characters
When a script file is executed on a node or list, the MPE mode is in effect. For example, when you enter
you are in MPE mode. MPE assumes only MPE commands are executed in MPE mode. If the script file contains NetCI commands, you must precede these commands with a special slash (/) character in order for the commands to be interpreted as NetCI commands. Refer to SCRIPT1 in the following example on the use of the slash character. A NetCI COMMENT command is available to allow you to include comments in a script file (containing NetCI commands) that will execute in NetCI mode. Refer to Example 1 for using the NetCI COMMENT command. Since there is an MPE COMMENT command, you can also use this command in a script file (containing MPE commands) that will execute on a node or list. When a script file executes on a node/list, you will be in MPE mode. Refer to Example 2 for using the MPE COMMENT command in a script file executing in MPE mode. Example 1 This example executes a script file called SCRIPT1 containing NetCI commands. To execute the script file, you enter
Since you are executing SCRIPT1 in the NetCI mode, you are using the NetCI COMMENT in the script file. The SCRIPT1 script file contains the following commands:
Example 2 This example executes a script file called SCRIPT2 on node Y, causing you to be in MPE mode. Since there is also an MPE COMMENT command, you do not need to use the NetCI COMMENT command. To execute the script file, you enter
The SCRIPT2 script file contains the following commands:
SCRIPT2 runs a program that lists attributes according to groups and users for an account called FINANCE. We know this information is for the FINANCE account because !1 references the first parms value specified in PLAY. The output will be stored in the log file called LOGFILE2. Example This example shows how the slash must precede the NetCI LOG, LOGRESET, LET, WHILE, INC, and ENDWHILE commands since the MPE mode will be established when you execute the script file on a node or list. For example, when you enter
you will be in MPE mode. A slash must precede each NetCI command as shown in SCRIPT3. The SCRIPT3 script file contains the following:
There are several considerations that apply to scripting which must be considered since input is redirected from the script file instead of the terminal. These considerations are:
|
![]() |
||
![]() |
![]() |
![]() |
|||||||||
|