Wed Jan 19 00:33:11 2011 UTC ()
Be consistent in using (fixed width font) literals.


(uwe)
diff -r1.2 -r1.3 src/share/man/man7/glob.7

cvs diff -r1.2 -r1.3 src/share/man/man7/glob.7 (expand / switch to unified diff)

--- src/share/man/man7/glob.7 2011/01/19 00:21:19 1.2
+++ src/share/man/man7/glob.7 2011/01/19 00:33:10 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: glob.7,v 1.2 2011/01/19 00:21:19 uwe Exp $ 1.\" $NetBSD: glob.7,v 1.3 2011/01/19 00:33:10 uwe Exp $
2.\" 2.\"
3.\" $OpenBSD: glob.7,v 1.3 2009/12/26 15:24:54 schwarze Exp $ 3.\" $OpenBSD: glob.7,v 1.3 2009/12/26 15:24:54 schwarze Exp $
4.\" 4.\"
5.\" Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> 5.\" Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
6.\" 6.\"
7.\" Permission to use, copy, modify, and distribute this software for any 7.\" Permission to use, copy, modify, and distribute this software for any
8.\" purpose with or without fee is hereby granted, provided that the above 8.\" purpose with or without fee is hereby granted, provided that the above
9.\" copyright notice and this permission notice appear in all copies. 9.\" copyright notice and this permission notice appear in all copies.
10.\" 10.\"
11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@@ -31,105 +31,106 @@ command arguments in the @@ -31,105 +31,106 @@ command arguments in the
31.Xr ksh 1 , 31.Xr ksh 1 ,
32and 32and
33.Xr sh 1 33.Xr sh 1
34shells as well as 34shells as well as
35the C library functions 35the C library functions
36.Xr fnmatch 3 36.Xr fnmatch 3
37and 37and
38.Xr glob 3 . 38.Xr glob 3 .
39A glob pattern is a word containing one or more unquoted 39A glob pattern is a word containing one or more unquoted
40.Ql \&? 40.Ql \&?
41or 41or
42.Ql * 42.Ql *
43characters, or 43characters, or
44.Dq [..] 44.Dq Li [..]
45sequences. 45sequences.
46.Pp 46.Pp
47Globs should not be confused with the more powerful 47Globs should not be confused with the more powerful
48regular expressions used by programs such as 48regular expressions used by programs such as
49.Xr grep 1 . 49.Xr grep 1 .
50While there is some overlap in the special characters used in regular 50While there is some overlap in the special characters used in regular
51expressions and globs, their meaning is different. 51expressions and globs, their meaning is different.
52.Pp 52.Pp
53The pattern elements have the following meaning: 53The pattern elements have the following meaning:
54.Bl -tag -width Ds 54.Bl -tag -width Ds
55.It \&? 55.It Li \&?
56Matches any single character. 56Matches any single character.
57.It \&* 57.It Li \&*
58Matches any sequence of zero or more characters. 58Matches any sequence of zero or more characters.
59.It [..] 59.It Li [..]
60Matches any of the characters inside the brackets. 60Matches any of the characters inside the brackets.
61Ranges of characters can be specified by separating two characters by a 61Ranges of characters can be specified by separating two characters by a
62.Ql - 62.Ql \-
63(e.g.\& 63(e.g.\&
64.Dq [a0-9] 64.Dq Li [a0-9]
65matches the letter 65matches the letter
66.Sq a 66.Sq a
67or any digit). 67or any digit).
68In order to represent itself, a 68In order to represent itself, a
69.Ql - 69.Ql \-
70must either be quoted or the first or last character in the character list. 70must either be quoted or the first or last character in the character list.
71Similarly, a 71Similarly, a
72.Ql \&] 72.Ql \&]
73must be quoted or the first character in the list if it is to represent itself 73must be quoted or the first character in the list if it is to represent itself
74instead of the end of the list. 74instead of the end of the list.
75Also, a 75Also, a
76.Ql \&! 76.Ql \&!
77appearing at the start of the list has special meaning (see below), so to 77appearing at the start of the list has special meaning (see below), so to
78represent itself it must be quoted or appear later in the list. 78represent itself it must be quoted or appear later in the list.
79.Pp 79.Pp
80Within a bracket expression, the name of a 80Within a bracket expression, the name of a
81.Em character class 81.Em character class
82enclosed in 82enclosed in
83.Sq [: 83.Ql [:
84and 84and
85.Sq :] 85.Ql :]
86stands for the list of all characters belonging to that class. 86stands for the list of all characters belonging to that class.
87Supported character classes: 87Supported character classes:
88.Bl -column ".Li xdigit" ".Li xdigit" ".Li xdigit" -offset indent 88.Bl -column ".Li xdigit" ".Li xdigit" ".Li xdigit" -offset indent
89.It Li "alnum" Ta Li "cntrl" Ta Li "lower" Ta Li "space" 89.It Li "alnum" Ta Li "cntrl" Ta Li "lower" Ta Li "space"
90.It Li "alpha" Ta Li "digit" Ta Li "print" Ta Li "upper" 90.It Li "alpha" Ta Li "digit" Ta Li "print" Ta Li "upper"
91.It Li "blank" Ta Li "graph" Ta Li "punct" Ta Li "xdigit" 91.It Li "blank" Ta Li "graph" Ta Li "punct" Ta Li "xdigit"
92.El 92.El
93.Pp 93.Pp
94These match characters using the macros specified in 94These match characters using the macros specified in
95.Xr ctype 3 . 95.Xr ctype 3 .
96A character class may not be used as an endpoint of a range. 96A character class may not be used as an endpoint of a range.
97.It [!..] 97.It Li [!..]
98Like [..], 98Like
 99.Li [..] ,
99except it matches any character not inside the brackets. 100except it matches any character not inside the brackets.
100.It \e 101.It Li \e
101Matches the character following it verbatim. 102Matches the character following it verbatim.
102This is useful to quote the special characters 103This is useful to quote the special characters
103.Ql \&? , 104.Ql \&? ,
104.Ql \&* , 105.Ql \&* ,
105.Ql \&[ , 106.Ql \&[ ,
106and 107and
107.Ql \e 108.Ql \e
108such that they lose their special meaning. 109such that they lose their special meaning.
109For example, the pattern 110For example, the pattern
110.Dq \e\e\e\&*\e[x]\e\&? 111.Dq Li \e\e\e\&*\e[x]\e\&?
111matches the string 112matches the string
112.Dq \e\&*[x]\&? . 113.Dq \e\&*[x]\&? .
113.El 114.El
114.Pp 115.Pp
115Note that when matching a pathname, the path separator 116Note that when matching a pathname, the path separator
116.Ql / , 117.Ql / ,
117is not matched by a 118is not matched by a
118.Ql \&? , 119.Ql \&? ,
119or 120or
120.Ql * , 121.Ql * ,
121character or by a 122character or by a
122.Dq [..] 123.Dq Li [..]
123sequence. 124sequence.
124Thus, 125Thus,
125.Pa /usr/*/*/X11 126.Pa /usr/*/*/X11
126would match 127would match
127.Pa /usr/X11R6/lib/X11 128.Pa /usr/X11R6/lib/X11
128and 129and
129.Pa /usr/X11R6/include/X11 130.Pa /usr/X11R6/include/X11
130while 131while
131.Pa /usr/*/X11 132.Pa /usr/*/X11
132would not match either. 133would not match either.
133Likewise, 134Likewise,
134.Pa /usr/*/bin 135.Pa /usr/*/bin
135would match 136would match