Shell Patterns
While most users learn shell pattern matching behavior early in their exposure to UNIX, it is useful to review it here before introducing the functions that implement it.
A shell pattern can consist of normal characters and meta-characters. Normal characters represent themselves, and meta-characters have a special meaning for pattern matching. The set of meta-characters for shell patterns is relatively small. They are
* | Star (asterisk) |
? | Question mark |
[ and ] | Square brackets |
! | Bang (in []) |
- | Hypen (in []) |
\ | Backslash |
Each meta-character is described in the subsections that follow.
The * Meta-Character
The * character can match zero or more characters. The following shell experiment on a FreeBSD system illustrates this meta-character ...
Get Advanced UNIX Programming 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.