Metacharacters

“I have never meta character I didn't like.” No, that is not what is meant here. A metacharacter is a character that has a special meaning. Five characters have special meanings. They are shown in Table 4.2 with an explanation of each of their meanings.

Table 4.2. Metacharacters for sub-patterns
Symbol Meaning
! Matches all strings except those matched by the pattern-list
* Matches zero or more occurrences of the pattern-list
? Matches zero or one occurrence of the pattern-list
@ Matches exactly one occurrence of the pattern-list
+ Matches one or more occurrences of the pattern-list

A pattern-list is one or more patterns separated by an ampersand (&) or a vertical bar (|). An & between two patterns indicates that both patterns ...

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.