Variable Substitution
No spaces should be used in the following expressions. The colon (:) is optional; if it’s included, var must be nonnull, as well as set.
Variable expression | Description |
---|---|
| Set each variable
|
${
| Use value of
|
${
| Use
|
${
| Use
|
${
| Use
|
${
| Use
|
${#
| Use the length of
|
${#*}, ${#@} | Use the number of positional parameters. |
${
| Use value of
|
${
| Same as # |
${
| Use value of
|
${
| Same as % |
${!
| List of variables whose
names begin with
|
${
| Starting at position
|
${
| Use value of
|
${
| Use value ... |
Get Linux in a Nutshell, 6th Edition 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.