Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (t - u) typeset(1)
NAME
typeset - Sets attributes and values for shell parameters
SYNOPSIS
typeset [+ | -HLRZfilrtux[n]] [name[=value ...]]
FLAGS
-f The names refer to function names rather than parameter names. No assignments can
be made and the only other valid flags are -t, -u, and -x. The -t flag turns on execution
tracing for this function. The -u flag causes this function to be marked undefined. The
FPATH variable is searched to find the function definition when the function is refer-
enced. The -x flags allows the function definition to remain in effect across shell pro-
cedures invoked by name.
-H Provides system-to-hostname
file mapping on machines that restrict the set of charac-
ters in filenames.
-i Parameter is an integer. This makes arithmetic faster. If n is nonzero, it defines the
output arithmetic base; otherwise, the first assignment determines the output base.
-l All uppercase characters are converted to lowercase. The uppercase -u flag is turned
off.
-L Left justifies and removes leading spaces from value.Ifn is nonzero, it defines the
width of the field; otherwise, it is determined by the width of the value of first assign-
ment. When the parameter is assigned, it is filled on the right with spaces or truncated,
if necessary, to fit into the field. Leading zeros are removed if the -Z flag is also set.
The -R flag is turned off.
-r The given names are marked read-only, and these names cannot be changed by subse-
quent assignment.
-R Right justifies and fills with leading spaces. If n is nonzero, it defines the width of the
field; otherwise, it is determined by the width of the value of first assignment. The field
is left-filled with spaces or truncated from the end if the parameter is reassigned. The
L flag is turned off.
-t Tags the named parameters. Tags are user definable and have no special meaning to
the shell.
-u All lowercase characters are converted to uppercase characters. The lowercase -l flag
is turned off.
-x The given names are marked for export.
-Z Right justifies and fills with leading zeros if the first nonspace character is a digit and
the -L flag was not set. If n is nonzero, it defines the width of the field; otherwise, it is
determined by the width of the value of first assignment.
DESCRIPTION
The typeset command assigns values to named parameters. The flags assign attributes to the
parameters.
When the typeset command is invoked inside a function, a new instance of the parameter name
is created. The parameter value and type are restored when the function completes.
Using + (plus sign) rather than - (dash) causes the flags to be turned off.
527188-003 Hewlett-Packard Company 9−25