HP-UX CMGR A.02.01 Administrator's and Developer's Guide
22
You can use variable names anywhere within a template. Several variable names, such as the
operation (op), are predefined. Other variables are provided by the user in the op command, or
assigned a default value in the template itself.
The var element has the following child element:
Child Element
Description
help
Optional.
prompt
Optional. Generally used to provide prompt-
level help.
The var element has the following attributes:
Attribute Description
id
Optional. Common Attribute.
if
Optional. Common Attribute.
if_op
Optional. Common Attribute.
internal
Optional. Set to yes to indicate that cmgr should never prompt for this variable.
Default is
no
.
name
Variable name string. The cmgr command logically replaces instances of $name in
the template with the current contents of the value attribute as they are
encountered during template processing.
prompt_level
The minimum value for the prompt argument to allow cmgr to prompt for this
variable. The cmgr command always prompts if the value attribute is null when it
encounters a variable replacement. Default level is 1.
value
The value to be assigned to the variable when a replacement opportunity has been
encountered in a template. The user can also set the value from the cmgr command
line or prompt.
validate
Specifies the validation function to perform when the value attribute for this element
is initially assigned or changed. If not specified, the
“default”
function is used.
The cmgr
command executes the validation function when the element's value attribute is initially
assigned or changed. The variable element handler returns the same value as the validation
routine. If a variable validation fails, cmgr terminates.
The following predefined validate functions are available:
Value Description
“default”
Equivalent to performing a regular expression validation with
the regular expression as specified by the value of the cmgr-
default-regex template variable. If cmgr-default-
regexdoes not exist or its value is null, default checks to
ensure that value contains only the following characters:
“a-z”, “A-Z”, “0-9”,”-“,”_”, “.”, "," , " ",
":", "/", "(", ")"