
Writing Technician Interface Scripts
1-8 114089 Rev. A
Defining a Pseudo-Variable Array
The Technician Interface script facility allows you to define a pseudo-variable
array. A true array is a set of consecutive memory locations used to store data.
Each item in the array is called an element. An element is a variable. To reference
an element of an array, you use a number called the index. In a pseudo-variable
array, the elements (variables) are not in consecutive memory locations. To create
a pseudo-array, use variable names that end in numbers (for example,
a1, a2, and
a3). The following script shows how to access a member of an array using an
index:
setenv a1 one
setenv a2 two
setenv a3 three
let index=2
echo “a[$index]=${a[$index]}”
a[2]=two
is displayed on the user’s console.
For specific instructions on using the commands in the previous example, see
Chapter 2.
Creating and Using Variables
This section explains how to view local and global variables, how to set variables,
and how to delete them.
Viewing Variables
You view the current list of variables stored in the local and global environment
variable tables using the
getenv command. For example, if you enter
getenv a
the system responds a = blue.
You can also use the
echo $
<variable_name>
command to view a variable.
For specific instructions on using the
getenv and echo commands, see Chapter 2.
Comentarios a estos manuales