summaryrefslogtreecommitdiffstats
path: root/doc/glob.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 12:52:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 12:52:31 (GMT)
commit5bc57d7b0f63d86fc383565d69f7704943fff94d (patch)
tree3ed6ba33b7a0eb1bb7d89c83f86bb2f420d5284a /doc/glob.n
parent7ea5d4dbe8b82a86701cec95132a8a9557a5f105 (diff)
downloadtcl-5bc57d7b0f63d86fc383565d69f7704943fff94d.zip
tcl-5bc57d7b0f63d86fc383565d69f7704943fff94d.tar.gz
tcl-5bc57d7b0f63d86fc383565d69f7704943fff94d.tar.bz2
More doc fix backporting
Diffstat (limited to 'doc/glob.n')
-rw-r--r--doc/glob.n34
1 files changed, 32 insertions, 2 deletions
diff --git a/doc/glob.n b/doc/glob.n
index 15ae60c..871f668 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.12 2002/07/01 18:24:39 jenglish Exp $
+'\" RCS: @(#) $Id: glob.n,v 1.12.2.1 2004/10/27 12:52:40 dkf Exp $
'\"
.so man.macros
.TH glob n 8.3 Tcl "Tcl Built-In Commands"
@@ -78,6 +78,9 @@ the Unix find command:
\fIp\fR (named pipe),
or \fIs\fR (socket), where multiple types may be specified in the list.
\fBGlob\fR will return all files which match at least one of the types given.
+Note that symbolic links will be returned both if \fB\-types l\fR is given,
+or if the target of a link matches the requested type. So, a link to
+a directory will be returned if \fB\-types d\fR was specified.
.RS
.PP
The second form specifies types where all the types given must match.
@@ -149,7 +152,13 @@ command if you want the list sorted).
Second, \fBglob\fR only returns the names of files that actually
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 ``~'' (for example through \fBglob *\fR or
+\fBglob -tails\fR, the returned list will not quote the tilde with
+``./''. 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"
.PP
Unlike other Tcl commands that will accept both network and native
@@ -184,6 +193,27 @@ When using the options, \fB\-directory\fR, \fB\-join\fR or \fB\-path\fR, glob
assumes the directory separator for the entire pattern is the standard
``:''. When not using these options, glob examines each pattern argument
and uses ``/'' unless the pattern contains a ``:''.
+.SH EXAMPLES
+Find all the Tcl files in the current directory:
+.CS
+\fBglob\fR *.tcl
+.CE
+.PP
+Find all the Tcl files in the user's home directory, irrespective of
+what the current directory is:
+.CS
+\fBglob\fR \-directory ~ *.tcl
+.CE
+.PP
+Find all subdirectories of the current directory:
+.CS
+\fBglob\fR \-type d *
+.CE
+.PP
+Find all files whose name contains an "a", a "b" or the sequence "cde":
+.CS
+\fBglob\fR \-type f *{a,b,cde}*
+.CE
.SH "SEE ALSO"
file(n)