You can define a server script line-by-line, create a file
that contains the command lines, or copy an existing script.
About this task
Restriction: You cannot redirect the output of a command within a server script.
Instead, run the script and then specify command redirection. For example, to direct the output of
script1 to the
c:\temp\test.out directory, run the script
and specify command redirection as in the following example:
run script1 > c:\temp\test.out
Procedure
-
Define a script with the DEFINE SCRIPT command.
You can initially define the first line of the script with this command. For example:
define script qaixc "select node_name from nodes where platform='aix'"
desc='Display AIX clients'
This
example defines the script as
QAIXC. When you run the script, all AIX® clients are displayed.
-
Define more lines in the script with the UPDATE SCRIPT command.
For example, you want to add a
QUERY SESSION command, enter:
update script qaixc "query session *"
- Optional:
You can specify a WAIT parameter with the DEFINE
CLIENTACTION command. By using this parameter, you can specify that the client action must
complete before the next step in the command script or macro is processed.
- Optional:
To help you determine where a problem is within a command in a script, use the ISSUE
MESSAGE command.