Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using parameter and variable expansion z/OS UNIX System Services User's Guide SA23-2279-00 |
||||||||||||||||||||||||||||||||||||||||||||||
A $ followed by a number stands for a positional parameter
passed to the script or function. A positional parameter is represented
with either a single digit (except 0) or two or more digits in braces;
for example, 7 and {15} are both valid representations of positional
parameters. For example, if the command:
appeared
in a shell script, it would echo the first positional parameter.Similarly, a $ followed by the name of a shell variable (such as $HOME) stands for the value of the variable. These constructs are called parameter expansions. In this sense, the term parameter can mean either a positional parameter or a shell variable. The tcsh shell also supports more complicated forms of parameter expansions, letting you obtain only part of a parameter value or a modified form of the value.
For example, to extract only part of a file name, you can add one of these modifiers as follows:
|
Copyright IBM Corporation 1990, 2014
|