HP StorageWorks Storage Mirroring Recover Scripting Guide (T5437-96009, November 2009)

12 of 332
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
exceeds the end value. If a step value is not provided, the default adds one to
the variable. Use the following syntax for the FOR loop.
FOR <variable> = <start_value> TO <end_value> [STEP <step_value>]
DO <statement_block> END
WHILE Loop—The WHILE loop evaluates a relational expression and, if it is
true, then the statement block is executed. When the statement block has
completed execution, the expression will be reevaluated again and, if it is
true, the statement block is executed again. This continues until the
expression is false. Use the conditions specified in the IF conditional to
create the relational expression and the following syntax for the WHILE loop.
WHILE <relational_expression> DO <statement_block> END
WRITE Command—The WRITE command writes values to the screen.
These values can be variables or constants of type integer$, string$, date$,
or time$. The write command is used in conjunction with either the IF
conditional, WHILE loop, or FOR loop.
Each command and assignment must end with a semi-colon. However, no
semicolon is necessary after the END keyword for the IF conditional and the loop
statements.
When using the Command Line client, a script file can be executed using the -f
option. Create a one-line batch file using the following command to initiate the
Command Line client with the -f option and specify the name of the script to
execute.
cmd /c DTCL -f "C:\Program Files\StorageWorks\Storage
Mirroring\scriptname.txt"
If you do not specify a path for the script file, Storage Mirroring Recover will look in
the directory where the DTCL -f command was executed.