13.5. Metacharacters
Metacharacters are special characters that are used to represent something other than themselves. As a rule of thumb, characters that are neither letters nor numbers may be metacharacters. The shell has its own set of metacharacters, often called shell wildcards. Shell metacharacters can be used to group commands together, to abbreviate filenames and pathnames, to redirect and pipe input/output, to place commands in the background, and so forth. Table 13.13 presents a partial list of shell metacharacters.
Metacharacter | Purpose | Example | Meaning |
---|---|---|---|
$ | Variable substitution | set name=Tom echo $name Tom | Sets the variable name to Tom; displays the value stored there. |
! | History substitution | !3 | Reexecutes ... |
Get UNIX® Shells by Example, Third 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.