
Writing Technician Interface Scripts
1-2
117382-A Rev. A
• Writing messages to the console, using the
echo
and the
printf
commands
• Recording console messages to a file, using the
record
command
• Handling and recovering from errors, using the
on error
command
• Inserting comments into a script file, using the pound sign (#)
• Debugging a script file, using the
verbose
command
• Saving or restoring variables to or from a file, using the
save env
and
source
env
commands
• Running a script file with command line arguments, using the
run
command
• Documenting a script file with command lines
About Variables
A variable is a location in the computer’s memory for storing a value. A variable
name identifies the location. Variable names can consist of up to 15 alphanumeric
characters and the underscore character (_). The first character of a variable name
must be an alphabetical character. The Technician Interface stores the value of a
variable as a string of ASCII characters. The maximum string length is 255
characters.
You can assign a value to a variable using one of the set variable commands
(
arrayenv, cutenv
, enumenv, instenv, let, setenv, mi/jointfilesconvert/97390/bget, or sprintf). For
instructions on using these commands, see Chapter 2.
After you have assigned a value to a variable, you can refer to the variable on a
command line within the script file by entering a dollar sign ($) before the variable
name (for example,
$a).
When you refer to a variable, the Technician Interface substitutes the value set for
the variable itself. If you want to prevent or delay the substitution of the variable,
enter the backslash character (\) before the $. The backslash character, also called
the escape character, indicates that special characters follow.
In the following script, the value of
a is substituted for $a when b is executed.
setenv a blue
setenv b “My color is \$a”
echo $b
My color is blue appears on the user’s console.
Commentaires sur ces manuels