O'Reilly logo

Korn Shell: Unix and Linux Programming Manual, Third Edition, The by Anatole Olczak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Variables

Like in other high-level progamming languages, variables are used by the Korn shell to store values. Variable names can begin with an alphabetic or underscore character, followed by one or more alphanumeric or underscore characters. Other variable names that contain only digits or special characters are reserved for special variables (called parameters) set directly by the Korn shell. Data types (called attributes) and one-dimensional arrays are also supported by the Korn shell.

Variable/Attribute Assignment Format

variable=declare variable and set it to null
typeset variable=declare variable and set it to null. If used within a function, then a local variable is declared.
variable=valueassign value to variable
typeset variable=value ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required