Chapter 3. Variables and Parameters

Variables

Special Parameters

Variable Expansion

Array Variables

Compound Variables

Quoting

Variables and parameters are used by the Korn shell to store values. Like other high-level programming languages, the Korn shell supports data types and arrays. This is a major difference with the Bourne, C shell, and other scripting languages, which have no concept of data types.

The Korn shell supports four data types: string, integer, float, and array. If a data type is not explicitly defined, the Korn shell will assume that the variable is a string.

By default, all variables are global in scope. However, it is possible to declare a local variable within a function. This is discussed in more detail later in this chapter. ...

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.