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 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.