-
Notifications
You must be signed in to change notification settings - Fork 0
Pattern
Nat! edited this page Feb 8, 2018
·
11 revisions
A pattern is basically the same as bash pattern matching, with the following extensions:
Pattern | Description |
---|---|
expr/ |
Matches any file or folder matched by expr and it's recursive contents |
/expr |
Matches expr only if it matches from the start |
! | Negate expression. It's not possible to negate a negated expression. |
All other expressions match filenames. |
Examples:
Pattern | bash pattern | Description |
---|---|---|
x | */x | x |
*.c | /.c | *.c |
/x | x | Match "x" only in the top folder |
x/ | /x/ | x/* |
/x/ | x/* | Match anything below a top folder named "x" |
Here is a simple example to match .txt
files that are stored somewhere inside
the doc folder or subfolders. But it avoids those, that are in an "old" folder.
mkdir .mulle-monitor/etc/match.d
cat <<EOF > .mulle-monitor/etc/match.d/00-doc-all
/doc/*.txt
!old/
EOF