Exclude patterns

From radmind

Revision as of 10:24, 7 April 2009 by Jaharmi@jaharmi.com (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

[edit] Paths with spaces

Exclude a path that contains a space by substituting “\b” for each space. For example, to exclude the path “/Library/Application Support/VMware Fusion/vmnet8/nat.mac” from VMware Fusion installations on Mac OS X, use:

# Excludes the path /Library/Application Support/VMware Fusion/vmnet8/nat.mac
x /Library/Application\bSupport/VMware\bFusion/vmnet8/nat.mac

This results in the following response from the twhich utility:

$ sudo twhich "/Library/Application Support/VMware Fusion/vmnet8/nat.mac"
# Exclude
# exclude pattern: /Library/Application Support/VMware Fusion/vmnet8/nat.mac

An alternative to using “/b” would be to substitute a wildcard characters. For a single space, “?” is an option:

# Excludes the path /Library/Application Support/VMware Fusion/vmnet8/nat.mac
# Uses the ? wildcard
x /Library/Application?Support/VMware?Fusion/vmnet8/nat.mac

The “[ ]” character list might also work, but has not been verified:

# Excludes the path /Library/Application Support/VMware Fusion/vmnet8/nat.mac
# Uses the [ ] character list
x /Library/Application[ ]Support/VMware[ ]Fusion/vmnet8/nat.mac

[edit] Paths with numbers

Some paths you intend to exclude may involve numbers. This is especially true for version numbers, which can vary over a range of software releases. Place a number range between angle brackets to construct a pattern, in the same manner as described for the config file syntax in the radmind man page.

For example, to exclude Python compiled and object files:

# Python compiled and object module files for Python 2.x and 3.x
x /Library/Python/<2-3>.<0-9>/site-packages/*.py[oc]

The <2-3>.<0-9> pattern would match both version 2.x and 3.x of Python. The ending *.py[oc] pattern would match files ending in either “.pyc” or “.pyo” in the “site-packages” directory.

Personal tools