HP StorageWorks Storage Mirroring Recover Scripting Guide (T5437-96022, November 2010)

Scripts
You can create script files to execute series and combinations of scripting commands to
meet specific needs. When working with scripts, keep in mind the following.
l When creating scripts, each commented line must start and end with the pound (or
number) sign (#).
l Scripts must use ANSI coding. Do not use Unicode or other formats.
l Variables can be used in commands to replace items that vary such as machine or
domain names. A variable name must start with the dollar sign ($) character and
can contain letters or numbers. Values are assigned to variables using the equals
(=) assignment statement. For example, valid variable assignment statements are
$MyDomain="domain.com"; and $MySource=alpha;.
l All commands return values which can also be assigned to variables. For
example, the connection command returns a connection ID for the connection
being created. The statement $ConnectionID=CONNECT dataset to target; saves
the connection ID as a variable. The variable components of the connect command
could be replaced as well. For example, $TheRepset="DataFiles";,
$TheTarget=beta;, and $ConnectionID=CONNECT $TheRepset to $TheTarget;
are all valid statements.
l Scripts can take advantage of four flow control programming constructs.
l IF conditional—The IF conditional expression is a comparison between two
values or variables. Use the following syntax for an IF conditional.
IF<relational_expression>THEN <statement_block> [ ELSE<statement_
block> ] END
Use the following conditions to create the relational expression.
l equal to =
l not equal to !=
l less than <
l less than or equal to <=
l greater than >
l greater than or equal to >=
l statement block—any sequence of valid commands
l FOR Loop—The FOR loop sets a variable to a start value, executes each
statement in the statement block, and then adds the step value to the
variable. If the new value of the variable does not exceed the end value then
the statements will be executed again. This continues until the variable