summaryrefslogtreecommitdiff
path: root/devdocs/bash/arithmetic-expansion.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/bash/arithmetic-expansion.html
new repository
Diffstat (limited to 'devdocs/bash/arithmetic-expansion.html')
-rw-r--r--devdocs/bash/arithmetic-expansion.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/devdocs/bash/arithmetic-expansion.html b/devdocs/bash/arithmetic-expansion.html
new file mode 100644
index 00000000..6634f237
--- /dev/null
+++ b/devdocs/bash/arithmetic-expansion.html
@@ -0,0 +1,8 @@
+<h1 class="subsection">Arithmetic Expansion</h1> <p>Arithmetic expansion allows the evaluation of an arithmetic expression and the substitution of the result. The format for arithmetic expansion is: </p> <div class="example"> <pre class="example">$(( expression ))
+</pre>
+</div> <p>The <var>expression</var> undergoes the same expansions as if it were within double quotes, but double quote characters in <var>expression</var> are not treated specially and are removed. All tokens in the expression undergo parameter and variable expansion, command substitution, and quote removal. The result is treated as the arithmetic expression to be evaluated. Arithmetic expansions may be nested. </p> <p>The evaluation is performed according to the rules listed below (see <a href="shell-arithmetic">Shell Arithmetic</a>). If the expression is invalid, Bash prints a message indicating failure to the standard error and no substitution occurs. </p><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 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/Arithmetic-Expansion.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Arithmetic-Expansion.html</a>
+ </p>
+</div>