|GNU Bash Reference Manual|
by Chet Ramey and Brian Fox
Paperback (6"x9"), 180 pages
RRP £19.95 ($29.95)
"An essential resource .... the most detailed coverage available for all aspects of Bash" --- Linux User and Developer Magazine (Issue 37, Mar 2004) Get a printed copy>>>
3.5.8 Filename Expansion
After word splitting, unless the
-f option has been set
(see section 4.3 The Set Builtin), Bash scans each word for the characters
‘*’, ‘?’, and ‘[’.
If one of these characters appears, then the word is
regarded as a pattern,
and replaced with an alphabetically sorted list of
file names matching the pattern. If no matching file names are found,
and the shell option
nullglob is disabled, the word is left
nullglob option is set, and no matches are found, the word
failglob shell option is set, and no matches are found,
an error message is printed and the command is not executed.
If the shell option
nocaseglob is enabled, the match is performed
without regard to the case of alphabetic characters.
When a pattern is used for filename generation, the character ‘.’
at the start of a filename or immediately following a slash
must be matched explicitly, unless the shell option
dotglob is set.
When matching a file name, the slash character must always be
In other cases, the ‘.’ character is not treated specially.
See the description of
shopt in section 4.2 Bash Builtin Commands,
for a description of the
shell variable may be used to restrict the set of filenames matching a
is set, each matching filename that also matches one of the patterns in
GLOBIGNORE is removed from the list of matches. The filenames
‘.’ and ‘..’
are always ignored when
is set and not null.
GLOBIGNORE to a non-null value has the effect of
shell option, so all other filenames beginning with a
‘.’ will match.
To get the old behavior of ignoring filenames beginning with a
‘.’, make ‘.*’ one of the patterns in
dotglob option is disabled when
|ISBN 0954161777||GNU Bash Reference Manual||See the print edition|