summaryrefslogtreecommitdiffstats
path: root/doc/glob.n
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-10-26 20:11:50 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-10-26 20:11:50 (GMT)
commit6b9dd216db20bac6c76552a6193d67a01e1d34ee (patch)
treeb86166558de62f70eef1a7524fac75f7b47a4f44 /doc/glob.n
parent236c395276f8f1cf4d5b745ea490b4966e6eb148 (diff)
downloadtcl-6b9dd216db20bac6c76552a6193d67a01e1d34ee.zip
tcl-6b9dd216db20bac6c76552a6193d67a01e1d34ee.tar.gz
tcl-6b9dd216db20bac6c76552a6193d67a01e1d34ee.tar.bz2
* changes: Updated for 8.5b2 release.core_8_5_b2
* doc/*.1: Revert doc changes that broke * doc/*.3: `make html` so we can get the release * doc/*.n: out the door.
Diffstat (limited to 'doc/glob.n')
-rw-r--r--doc/glob.n83
1 files changed, 24 insertions, 59 deletions
diff --git a/doc/glob.n b/doc/glob.n
index ca92e2a..c20ce49 100644
--- a/doc/glob.n
+++ b/doc/glob.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: glob.n,v 1.19 2007/10/24 14:29:38 dkf Exp $
+'\" RCS: @(#) $Id: glob.n,v 1.20 2007/10/26 20:11:52 dgp Exp $
'\"
.so man.macros
.TH glob n 8.3 Tcl "Tcl Built-In Commands"
@@ -19,9 +19,7 @@ glob \- Return names of files that match patterns
.SH DESCRIPTION
.PP
-This command performs file name
-.QW globbing
-in a fashion similar to
+This command performs file name ``globbing'' in a fashion similar to
the csh shell. It returns a list of the files whose names match any
of the \fIpattern\fR arguments. No particular order is guaranteed
in the list, so if a sorted list is required the caller should use
@@ -103,9 +101,8 @@ The following are equivalent:
\fBglob */\fR
.CE
.RE
-except that the first case doesn't return the trailing
-.QW /
-and is more platform independent.
+except that the first case doesn't return the trailing ``/'' and
+is more platform independent.
.RE
.TP
\fB\-\|\-\fR
@@ -132,38 +129,20 @@ Matches the character \fIx\fR.
\fB{\fIa\fB,\fIb\fB,\fI...\fR}
Matches any of the strings \fIa\fR, \fIb\fR, etc.
.LP
-On Unix, as with csh, a
-.QW .
-at the beginning of a file's name or just after a
-.QW /
-must be matched explicitly or with a {} construct, unless the
-.QW "-types hidden"
-flag is given (since
-.QW .
-at the beginning
+On Unix, as with csh, a ``.'' at the beginning of a file's name or just
+after a ``/'' must be matched explicitly or with a {} construct,
+unless the ``-types hidden'' flag is given (since ``.'' at the beginning
of a file's name indicates that it is hidden). On other platforms,
-files beginning with a
-.QW .
-are handled no differently to any others,
-except the special directories
-.QW .
-and
-.QW ..
-which must be matched explicitly (this is to avoid a recursive pattern like
-.QW "glob -join * * * *"
-from recursing up the directory hierarchy as well as down). In addition, all
-.QW /
-characters must be matched explicitly.
+files beginning with a ``.'' are handled no differently to any others,
+except the special directories ``.'' and ``..'' which must be matched
+explicitly (this is to avoid a recursive pattern like ``glob -join * *
+* *'' from recursing up the directory hierarchy as well as down).
+In addition, all ``/'' characters must be matched explicitly.
.LP
-If the first character in a \fIpattern\fR is
-.QW ~
-then it refers to the home directory for the user whose name follows the
-.QW ~ .
-If the
-.QW ~
-is followed immediately by
-.QW /
-then the value of the HOME environment variable is used.
+If the first character in a \fIpattern\fR is ``~'' then it refers
+to the home directory for the user whose name follows the ``~''.
+If the ``~'' is followed immediately by ``/'' then the value of
+the HOME environment variable is used.
.LP
The \fBglob\fR command differs from csh globbing in two ways.
First, it does not sort its result list (use the \fBlsort\fR
@@ -173,33 +152,24 @@ exist; in csh no check for existence is made unless a pattern
contains a ?, *, or [] construct.
.LP
When the \fBglob\fR command returns relative paths whose filenames
-start with a tilde
-.QW ~
-(for example through \fBglob *\fR or
+start with a tilde ``~'' (for example through \fBglob *\fR or
\fBglob -tails\fR, the returned list will not quote the tilde with
-.QW ./ .
-This means care must be taken if those names are later to
+``./''. This means care must be taken if those names are later to
be used with \fBfile join\fR, to avoid them being interpreted as
absolute paths pointing to a given user's home directory.
.SH "PORTABILITY ISSUES"
-.TP
+.PP
\fBWindows\fR
.
For Windows UNC names, the servername and sharename components of the path
may not contain ?, *, or [] constructs. On Windows NT, if \fIpattern\fR is
-of the form
-.QW \fB~\fIusername\fB@\fIdomain\fR
-it refers to the home
+of the form ``\fB~\fIusername\fB@\fIdomain\fR'' it refers to the home
directory of the user whose account information resides on the specified NT
domain server. Otherwise, user account information is obtained from
the local computer. On Windows 95 and 98, \fBglob\fR accepts patterns
-like
-.QW .../
-and
-.QW ..../
-for successively higher up parent directories.
-.RS
-.PP
+like ``.../'' and ``..../'' for successively higher up parent directories.
+
+.
Since the backslash character has a special meaning to the glob
command, glob patterns containing Windows style path separators need
special care. The pattern \fIC:\e\efoo\e\e*\fR is interpreted as
@@ -226,12 +196,7 @@ Find all subdirectories of the current directory:
\fBglob\fR \-type d *
.CE
.PP
-Find all files whose name contains an
-.QW a ,
-a
-.QW b
-or the sequence
-.QW cde :
+Find all files whose name contains an "a", a "b" or the sequence "cde":
.CS
\fBglob\fR \-type f *{a,b,cde}*
.CE