
Writing Technician Interface Scripts
2-14
308660-14.00 Rev 00
The backslash character (\) allows you to continue a command line on the
following physical line. When used in this way, the backslash is referred to as a
line continuation character. The line continuation character makes it easier for
you to read the script file. The maximum command line size is still restricted to
255 characters.
Example 2
The following example shows an if command using the backslash character:
if $num = 1 then ; \
echo “The number is 1”;
We recommend that you indent the additional commands to make the script file
easier to read. Also, if there is a large amount of code following the
if command,
use a
goto command to branch around the conditional code.
Example 3
The following example shows an if command with a goto command:
if $num !=1 then ; goto :IF_10:
echo “the number is 1”;
:IF_10:
Example 4
The following script shows how the if command is used to pass parameters into
the script file.
echo “Number of parameters entered on run line: $#”
let index = 1
:LOOP:
if $index > $# then; goto :LOOP_END:
echo “Parameter $index: ${[$index]}”
let index = $index + 1
goto :LOOP:
:LOOP_END:
To test whether a variable is defined, use the if command with the following
syntax:
if $?
<variable_name>
=1
where 1=defined.
Commentaires sur ces manuels