Cfpeek User Manual (split by section):   Section:   Chapter:FastBack: Tutorial   Up: Tutorial   FastForward: Formats   Contents: Table of ContentsIndex: Concept Index

3.6 Pattern Lookups

Apart from literal pathname, a pathname pattern is allowed as a key. A pattern can contain wildcards in place of path components. Two wildcards are defined: ‘*’ and ‘%’. A ‘%’ matches any single keyword:

$ cfpeek sample.conf .%.pidfile
.program="b".pidfile: /var/run/b.pid

A ‘*’ wildcard matches zero or more keywords appearing in its place:

$ cfpeek sample.conf .*.pidfile
.pidfile: /var/run/example
.program="b".pidfile: /var/run/b.pid

In addition to these wildcards, tags in a pattern can contain traditional globbing patterns, as described in http://www.manpagez.com/man/3/fnmatch.

$ cfpeek sample.conf '.program=[ab].pidfile'
.program="b".pidfile: /var/run/b.pid

Pattern lookups can be disabled using the --literal (-L) command line option. There may be two reasons for doing so. First, literal lookups are somewhat faster, so if you don’t need pattern matching using --literal can save you a couple of CPU cycles. Secondly, if any of your identifiers contain ‘*’ or ‘%’ characters, you will have to use --literal to prevent them from being treated as wildcards.

Cfpeek User Manual (split by section):   Section:   Chapter:FastBack: Tutorial   Up: Tutorial   FastForward: Formats   Contents: Table of ContentsIndex: Concept Index