Pattern-Matching Characters

The material in this section is adapted from the Bash Reference Manual (http://www.gnu.org/software/bash/manual/bashref.html; see Pattern-Matching Characters).

Table A-19. Pattern-matching characters

Character

Meaning

*

Matches any string, including the null string.

?

Matches any single character.

[ … ]

Matches any one of the enclosed characters.

[! … ] or [^ … ]

Matches any character not enclosed.

The following POSIX character classes may be used within [], e.g., [[:alnum:]]; consult the grep or egrep manpage on your system for more details.

[[:alnum:]] [[:alpha:]] [[:ascii:]] [[:blank:]] [[:cntrl:]] [[:digit:]]
[[:graph:]] [[:lower:]] [[:print:]] [[:punct:]] [[:space:]] [[:upper:]]
[[:word:]]  [[:xdigit:]]

The word character class matches letters, digits, and the character _.

[=c=] matches all characters with the same collation weight (as defined by the current locale) as the character c, while [.symbol.] matches the collating symbol symbol.

These character classes are affected by the locale setting. To get the traditional Unix values, use LC_COLLATE=C or LC_ALL=C.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.109.30