diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/bash/shell-expansions.html | |
new repository
Diffstat (limited to 'devdocs/bash/shell-expansions.html')
| -rw-r--r-- | devdocs/bash/shell-expansions.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/devdocs/bash/shell-expansions.html b/devdocs/bash/shell-expansions.html new file mode 100644 index 00000000..455757dd --- /dev/null +++ b/devdocs/bash/shell-expansions.html @@ -0,0 +1,13 @@ +<h1 class="section">Shell Expansions</h1> <p>Expansion is performed on the command line after it has been split into <code>token</code>s. There are seven kinds of expansion performed: </p> <ul> <li> brace expansion </li> +<li> tilde expansion </li> +<li> parameter and variable expansion </li> +<li> command substitution </li> +<li> arithmetic expansion </li> +<li> word splitting </li> +<li> filename expansion </li> +</ul> <p>The order of expansions is: brace expansion; tilde expansion, parameter and variable expansion, arithmetic expansion, and command substitution (done in a left-to-right fashion); word splitting; and filename expansion. </p> <p>On systems that can support it, there is an additional expansion available: <em>process substitution</em>. This is performed at the same time as tilde, parameter, variable, and arithmetic expansion and command substitution. </p> <p>After these expansions are performed, quote characters present in the original word are removed unless they have been quoted themselves (<em>quote removal</em>). </p> <p>Only brace expansion, word splitting, and filename expansion can increase the number of words of the expansion; other expansions expand a single word to a single word. The only exceptions to this are the expansions of <code>"$@"</code> and <code>$*</code> (see <a href="special-parameters">Special Parameters</a>), and <code>"${<var>name</var>[@]}"</code> and <code>${<var>name</var>[*]}</code> (see <a href="arrays">Arrays</a>). </p> <p>After all expansions, <code>quote removal</code> (see <a href="quote-removal">Quote Removal</a>) is performed. </p> <ul class="section-toc"> <li><a href="brace-expansion" accesskey="1">Brace Expansion</a></li> <li><a href="tilde-expansion" accesskey="2">Tilde Expansion</a></li> <li><a href="shell-parameter-expansion" accesskey="3">Shell Parameter Expansion</a></li> <li><a href="command-substitution" accesskey="4">Command Substitution</a></li> <li><a href="arithmetic-expansion" accesskey="5">Arithmetic Expansion</a></li> <li><a href="process-substitution" accesskey="6">Process Substitution</a></li> <li><a href="word-splitting" accesskey="7">Word Splitting</a></li> <li><a href="filename-expansion" accesskey="8">Filename Expansion</a></li> <li><a href="quote-removal" accesskey="9">Quote Removal</a></li> </ul><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>Licensed under the GNU Free Documentation License.<br> + <a href="https://www.gnu.org/software/bash/manual/html_node/Shell-Expansions.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Shell-Expansions.html</a> + </p> +</div> |
