Parameter Expansion

Parameter expansion substitutes the contents of the parameter in the command line. If the parameter is a variable name, the shell expands the value of the variable and replaces the variable name with the value of the variable. If the parameter is a number, the parameter is a positional parameter and represents a value on the command line. In the following example, two variables are defined. A third variable is then defined that uses the first two variables as parameters:

typeset Program=$0
typeset host=$(hostname)
typeset OutFile="/root/CHECKIT/checkout/${Program} .${host} .Current_Output"
echo $OutFile

To better illustrate this example, the example has been placed in a file called Example51.ksh. The following is the execution ...

Get Korn Shell Programming by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.