${var
}
|
The value of variable var
.
|
${var
[i
]}
|
Select word or words in position i
of
var
. i
can be a single number,
a range m
-
n
,
a range -
n
(missing m
implies 1),
a range m
-
(missing n
implies all
remaining words), or *
(select all words). i
can also
be a variable that expands to one of these values.
|
${#var
}
|
The number of words in var
.
|
${#argv}
|
The number of command-line arguments.
|
${argv[n
]}
|
Individual arguments on command line (positional parameters).
n
is a number (1, 12, etc.).
|
${n
}
|
Same as ${argv[
n
]}
.
|
${argv[*]}
|
All arguments on command line.
|
$*
|
Same as $argv[*]
.
|
${argv[$#argv]}
|
The last argument.
|
${?var
}
|
Return 1 if var
is set; 0 if var
is not set.
|
! ${?var
}
|
Return 0 if var
is set; 1 if var
is not set.
|
$$
|
Process number of current shell; useful as part of a filename
for creating temporary files with unique names.
|
$<
|
Read a line from standard input.
|