X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=original%2Fman7%2Fglob.7;h=77c18b60ec68cccdb5c3e5a09a1d81aae898fb18;hb=110dba020f489b75aff2497105f7970c05e2b87c;hp=e8a3f43df3c62870b97d5cdb986031b7e6a9b256;hpb=633a2252e0be3c867dce264a180a89ce8181d36f;p=linuxjm%2FLDP_man-pages.git diff --git a/original/man7/glob.7 b/original/man7/glob.7 index e8a3f43d..77c18b60 100644 --- a/original/man7/glob.7 +++ b/original/man7/glob.7 @@ -1,5 +1,6 @@ .\" Copyright (c) 1998 Andries Brouwer .\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of @@ -16,27 +17,27 @@ .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public -.\" License along with this manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END .\" .\" 2003-08-24 fix for / by John Kristoff + joey .\" -.TH GLOB 7 2003-08-24 "Linux" "Linux Programmer's Manual" +.TH GLOB 7 2012-07-28 "Linux" "Linux Programmer's Manual" .SH NAME -glob \- Globbing pathnames +glob \- globbing pathnames .SH DESCRIPTION -Long ago, in Unix V6, there was a program +Long ago, in UNIX\ V6, there was a program .I /etc/glob that would expand wildcard patterns. -Soon afterwards this became a shell built-in. +Soon afterward this became a shell built-in. These days there is also a library routine .BR glob (3) that will perform this function for a user program. The rules are as follows (POSIX.2, 3.13). -.SS "Wildcard Matching" +.SS Wildcard matching A string is a wildcard pattern if it contains one of the characters \(aq?\(aq, \(aq*\(aq or \(aq[\(aq. Globbing is the operation @@ -99,16 +100,17 @@ If a filename starts with a \(aq.\(aq, this character must be matched explicitly. (Thus, \fIrm\ *\fP will not remove .profile, and \fItar\ c\ *\fP will not archive all your files; \fItar\ c\ .\fP is better.) -.SS "Empty Lists" +.SS Empty lists The nice and simple rule given above: "expand a wildcard pattern -into the list of matching pathnames" was the original Unix +into the list of matching pathnames" was the original UNIX definition. It allowed one to have patterns that expand into an empty list, as in -.br + .nf xv \-wait 0 *.gif *.jpg .fi + where perhaps no *.gif files are present (and this is not an error). However, POSIX requires that a wildcard pattern is left @@ -116,20 +118,24 @@ unchanged when it is syntactically incorrect, or the list of matching pathnames is empty. With .I bash -one can force the classical behavior by setting -.IR allow_null_glob_expansion=true . +one can force the classical behavior using this command: + + shopt \-s nullglob +.\" In Bash v1, by setting allow_null_glob_expansion=true (Similar problems occur elsewhere. -E.g., where old scripts have -.br +For example, where old scripts have + .nf rm \`find . \-name "*~"\` .fi + new scripts require -.br + .nf rm \-f nosuchfile \`find . \-name "*~"\` .fi + to avoid error messages from .I rm called with an empty argument list.) @@ -145,11 +151,11 @@ more copies of the preceding thing. Now that regular expressions have bracket expressions where the negation is indicated by a \(aq^\(aq, POSIX has declared the effect of a wildcard pattern "\fI[^...]\fP" to be undefined. -.SS Character classes and Internationalization +.SS Character classes and internationalization Of course ranges were originally meant to be ASCII ranges, so that "\fI[\ \-%]\fP" stands for "\fI[\ !"#$%]\fP" and "\fI[a\-z]\fP" stands for "any lowercase letter". -Some Unix implementations generalized this so that a range X\-Y +Some UNIX implementations generalized this so that a range X\-Y stands for the set of characters with code between the codes for X and for Y. However, this requires the user to know the @@ -197,13 +203,20 @@ where the string between "\fI[=\fP" and "\fI=]\fP" is any collating element from its equivalence class, as defined for the current locale. For example, "\fI[[=a=]]\fP" might be equivalent -.\" FIXME . the accented 'a' characters are not rendering properly -.\" mtk May 2007 -to "\fI[aáàäâ]\fP" (warning: Latin-1 here), that is, +to "\fI[a\('a\(`a\(:a\(^a]\fP", that is, to "\fI[a[.a-acute.][.a-grave.][.a-umlaut.][.a-circumflex.]]\fP". -.SH "SEE ALSO" +.SH SEE ALSO .BR sh (1), .BR fnmatch (3), .BR glob (3), .BR locale (7), .BR regex (7) +.SH COLOPHON +This page is part of release 3.68 of the Linux +.I man-pages +project. +A description of the project, +information about reporting bugs, +and the latest version of this page, +can be found at +\%http://www.kernel.org/doc/man\-pages/.