- typeset - declare or display variables with attributes
- typeset [ options ] [name[=value]...]
- typeset [ options ] -f [name...]
- Without the -f option, typeset sets, unsets, or displays attributes of variables as specified with the options. If the first
option is specified with a - then the attributes are set for each of the given names. If the first option is specified with a +,
then the specified attributes are unset. If =value is specified value is assigned before the attributes are set.
- When typeset is called inside a function defined with the function reserved word, and name does not contain a .,
then a local variable statically scoped to that function will be created.
- Not all option combinations are possible. For example, the numeric options -i, -E, and -F cannot be specified with the
justification options -L, -R, and -Z.
- Note that the following preset aliases are set by the shell:
- typeset -C.
- typeset -lE.
- typeset -f.
- typeset -li.
- typeset -n.
- If no names are specified then variables that have the specified options are displayed. If the first option is specified with a leading
- then the name and value of each variable is written to standard output. Otherwise, only the names are written. If no options are specified
or just -p is specified, then the names and attributes of all variables that have attributes are written to standard output. When -f
is specified, the names displayed will be function names.
- If -f is specified, then each name refers to a function and the only valid options are -u and -t. In this case no
=value can be specified.
- typeset is built-in to the shell as a declaration command so that field splitting and pathname expansion are not performed on the
arguments. Tilde expansion occurs on value.
- Indexed array. This is the default. If [type] is specified, each subscript is interpreted as a
value of type type. The option value may be omitted.
- Each name may contain binary data. Its value is the mime base64 encoding of the data. It can be used with -Z, to
specify fixed sized fields.
- Each of the options and names refers to a function.
- An integer. base represents the arithmetic base from 2 to 64. The option value may be omitted. The default
value is 10.
- Convert uppercase character to lowercase. Unsets -u attribute. When used with -i, -E, or -F indicates
- Move. The value is the name of a variable whose value will be moved to name. The orignal variable will be unset. Cannot be
used with any other options.
- Name reference. The value is the name of a variable that name references. name cannot contain a .. Cannot be
use with any other options.
- Causes the output to be in a format that can be used as input to the shell to recreate the attributes for variables.
- Enables readonly. Once enabled it cannot be disabled. See readonly(1).
- Used with -i to restrict integer size to short.
- When used with -f, enables tracing for each of the specified functions. Otherwise, -t is a user defined attribute
and has no meaning to the shell.
- Without -f or -i, converts lowercase character to uppercase and unsets -l. With -f specifies that name
is a function that hasn't been loaded yet. With -i specifies that the value will be displayed as an unsigned integer.
- Puts each name on the export list. See export(1). name cannot
contain a ..
- Associative array. Each name will converted to an associate array. If a variable already exists, the current value will
become index 0.
- Compound variable. Each name will be a compound variable. If value names a compound variable it will be copied to name
. Otherwise if the variable already exists, it will first be unset.
- Floating point number represented in scientific notation. n specifies the number of significant figures when the
value is expanded. The option value may be omitted. The default value is 10.
- Floating point. n is the number of places after the decimal point when the value is expanded. The option value
may be omitted. The default value is 10.
- Hostname mapping. Each name holds a native pathname. Assigning a UNIX format pathname will cause it to be converted to a
pathname suitable for the current host. This has no effect when the native system is UNIX.
- Left justify. If n is given it represents the field width. If the -Z attribute is also specified, then
leading zeros are stripped. The option value may be omitted.
- Right justify. If n is given it represents the field width. If the -Z attribute is also specified, then
zeros will be used as the fill character. Otherwise, spaces are used. The option value may be omitted.
- Floating point number represented in hexadecimal notation. n specifies the number of significant figures when the
value is expanded. The option value may be omitted. The default value is 2*sizeof(long long).
- -h string
- Used within a type definition to provide a help string for variable name. Otherwise, it is ignored.
- Used with a type definition to indicate that the variable is shared by each instance of the type. When used inside a function
defined with the function reserved word, the specified variables will have function static scope. Otherwise, the variable is unset prior to
processing the assignment list.
- -T tname
- tname is the name of a type name given to each name.
- Zero fill. If n is given it represents the field width. The option value may be omitted.
- No errors occurred.
- An error occurred.
- readonly(1), export(1)
- typeset (AT&T Research) 2008-08-04
- David Korn <firstname.lastname@example.org>
- Copyright © 1982-2010 AT&T Intellectual Property