
Writing Technician Interface Scripts
2-4 114089 Rev. A
The cutenv command has the following syntax:
cutenv [-s][-d
<delimiter>
][-f
<list>
| -c
<list>
]
<variable_name>
“
<text_string>
”
-s suppresses
<text_string>
with no delimiter characters.
-d
<delimiter>
sets the field delimiter to
<delimiter>
. The default is a tab.
Characters with a special meaning to the Technician Interface interpreter, such as
a tab or space character, must be set in quotes.
-f
<list>
is field position. Instead of character positions,
<list>
specifies fields that
are separated by a delimiter (for example, a tab). Separate variables are created for
each noncontiguous field of characters selected. For example:
1,4,7 represent fields 1, 4, and 7.
-c
<list>
is character position.
<list>
is a comma-separated list of integer field
numbers (in increasing order), with an optional hyphen (
-) to indicate ranges.
Separate variables are created for each noncontiguous set of characters. For
example:
2,4,6 represent characters 2, 4, and 6.
1-5,9 represent characters 1 through 5, inclusive, and 9.
-5,10 represent the first character in the list through 5, inclusive, and 10.
5- represent the character 5 through the last character in the list, inclusive.
Numbers and number ranges may be repeated, overlapping, and in any order. You
can select fields or columns not present in the text string.
<variable_name>
is the prefix or name representing the pseudo-variable array.
<text_string>
with no field delimiters is normally passed through in its entirety.
The following sample script shows how you use the
cutenv command to assign
portions of 192.32.100.55 to a pseudo-variable array:
cutenv -d . -f 1,3 addr_ “192.32.100.55”
echo $addr_0 $addr_1 $addr_2
2 192 100
Comentários a estes Manuais