Any character that appears in a pattern, other than the special pattern characters described below, matches itself. The NUL character may not occur in a pattern. The special pattern characters must be quoted if they are to be matched literally.
The special pattern characters have the following meanings:
*
?
[...]
[:
class:]
, where class is one of the
following classes defined in the POSIX.2 standard:
alnum alpha ascii blank cntrl digit graph lower print punct space upper xdigitA character class matches any character belonging to that class. Within `[' and `]', an equivalence class can be specified using the syntax
[=
c=]
, which
matches all characters with the same collation weight (as defined
by the current locale) as the character c.
Within `[' and `]', the syntax [.
symbol.]
matches the collating symbol symbol.
If the extglob
shell option is enabled using the shopt
builtin, several extended pattern matching operators are recognized.
In the following description, a pattern-list is a list of one
or more patterns separated by a `|'.
Composite patterns may be formed using one or more of the following
sub-patterns:
?(pattern-list)
*(pattern-list)
+(pattern-list)
@(pattern-list)
!(pattern-list)
Go to the first, previous, next, last section, table of contents.