📄 glob.n
字号:
'\"'\" Copyright (c) 1993 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) glob.n 1.11 96/08/26 12:59:59'\" .so man.macros.TH glob n 7.5 Tcl "Tcl Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEglob \- Return names of files that match patterns.SH SYNOPSIS\fBglob \fR?\fIswitches\fR? \fIpattern \fR?\fIpattern ...\fR?.BE.SH DESCRIPTION.PPThis command performs file name ``globbing'' in a fashion similar tothe csh shell. It returns a list of the files whose names match anyof the \fIpattern\fR arguments..LPIf the initial arguments to \fBglob\fR start with \fB\-\fR thenthey are treated as switches. The following switches arecurrently supported:.TP 15\fB\-nocomplain\fRAllows an empty list to be returned without error; without thisswitch an error is returned if the result list would be empty..TP 15\fB\-\|\-\fRMarks the end of switches. The argument following this one willbe treated as a \fIpattern\fR even if it starts with a \fB\-\fR..PPThe \fIpattern\fR arguments may contain any of the followingspecial characters:.TP 10\fB?\fRMatches any single character..TP 10\fB*\fRMatches any sequence of zero or more characters..TP 10\fB[\fIchars\fB]\fRMatches any single character in \fIchars\fR. If \fIchars\fRcontains a sequence of the form \fIa\fB\-\fIb\fR then anycharacter between \fIa\fR and \fIb\fR (inclusive) will match..TP 10\fB\e\fIx\fRMatches the character \fIx\fR..TP 10\fB{\fIa\fB,\fIb\fB,\fI...\fR}Matches any of the strings \fIa\fR, \fIb\fR, etc..LPAs with csh, a ``.'' at the beginning of a file's name or justafter a ``/'' must be matched explicitly or with a {} construct.In addition, all ``/'' characters must be matched explicitly..LPIf the first character in a \fIpattern\fR is ``~'' then it refersto the home directory for the user whose name follows the ``~''.If the ``~'' is followed immediately by ``/'' then the value ofthe HOME environment variable is used..LPThe \fBglob\fR command differs from csh globbing in two ways.First, it does not sort its result list (use the \fBlsort\fRcommand if you want the list sorted).Second, \fBglob\fR only returns the names of files that actuallyexist; in csh no check for existence is made unless a patterncontains a ?, *, or [] construct..SH PORTABILITY ISSUES.PPUnlike other Tcl commands that will accept both network and nativestyle names (see the \fBfilename\fR manual entry for details on hownative and network names are specified), the \fBglob\fR command onlyaccepts native names. Also, for Windows UNC names, the servername andsharename components of the path may not contain ?, *, or []constructs. .SH KEYWORDSexist, file, glob, pattern
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -