mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
notes: add Pattern Matching section
This commit is contained in:
parent
2cdd540ed7
commit
1640914ea0
1 changed files with 23 additions and 0 deletions
23
NOTES.md
23
NOTES.md
|
|
@ -242,7 +242,30 @@ When a pattern is used for filename expansion, the character '.' at the start of
|
|||
a filename or immediately following a slash must be matched explicitly. In order
|
||||
to match the filenames '.' and '..', the pattern must begin with '.'
|
||||
|
||||
When matching a filename, the slash character must always be matched explicitly
|
||||
by a slash in the pattern.
|
||||
|
||||
##### Pattern Matching
|
||||
cf. 3.5.8.1 Pattern Matching
|
||||
|
||||
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 have the following meanings:
|
||||
'\*'
|
||||
Matches any string, including the null string.
|
||||
|
||||
The special pattern characters must be quoted if they are to be matched
|
||||
literally.
|
||||
|
||||
e.g. this is the required behaviour
|
||||
```shell
|
||||
bash-5.1$ ls *there
|
||||
'hello*there' 'hi*there' noonethere
|
||||
bash-5.1$ ls *'*'there
|
||||
'hello*there' 'hi*there'
|
||||
```
|
||||
|
||||
#### Quote Removal
|
||||
TODO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue