Variable Attributes

Variables can have one or more attributes that specify their internal representation, scope, or the way they are displayed.

Variable Attribute Assignment Format

typeset –H variableSet Unix to host-name file mapping for non-Unix systems
typeset –i variableSet variable to be integer type
typeset –in variableSet variable to be integer type with base n
typeset –l variableSet variable to lower case
typeset –L variableLeft justify variable; the field width is specified by the first assignment
typeset –Ln variableLeft justify variable; set field width to n
typeset –LZn variableLeft justify variable; set field width to n and strip leading zeros
typeset –r variableSet variable to be readonly (same as readonly)
typeset –R variableRight justify ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.