(features.info)Brace Expansion
Brace Expansion
===============
Brace expansion is a mechanism by which arbitrary strings may be
generated. This mechanism is similar to PATHNAME EXPANSION (see the
Bash manual page for details), but the file names generated need not
exist. Patterns to be brace expanded take the form of an optional
PREAMBLE, followed by a series of comma-separated strings between a
pair of braces, followed by an optional POSTAMBLE. The preamble is
prepended to each string contained within the braces, and the postamble
is then appended to each resulting string, expanding left to right.
Brace expansions may be nested. The results of each expanded string
are not sorted; left to right order is preserved. For example,
a{d,c,b}e
expands into ADE ACE ABE.
Brace expansion is performed before any other expansions, and any
characters special to other expansions are preserved in the result. It
is strictly textual. Bash does not apply any syntactic interpretation
to the context of the expansion or the text between the braces.
A correctly-formed brace expansion must contain unquoted opening and
closing braces, and at least one unquoted comma. Any incorrectly
formed brace expansion is left unchanged.
This construct is typically used as shorthand when the common prefix
of the strings to be generated is longer than in the above example:
mkdir /usr/local/src/bash/{old,new,dist,bugs}
or
chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
Next: C Shell Builtins Prev: Tilde Expansion Up: Csh Features
[ Dokumentation lokal installierter Software ]