blob: 427d38900b851bdf1628d82fcf7917fcd8c6bc0e (
plain)
1
2
3
4
5
6
|
<h1 class="subsection">Positional Parameters</h1> <p>A <em>positional parameter</em> is a parameter denoted by one or more digits, other than the single digit <code>0</code>. Positional parameters are assigned from the shell’s arguments when it is invoked, and may be reassigned using the <code>set</code> builtin command. Positional parameter <code>N</code> may be referenced as <code>${N}</code>, or as <code>$N</code> when <code>N</code> consists of a single digit. Positional parameters may not be assigned to with assignment statements. The <code>set</code> and <code>shift</code> builtins are used to set and unset them (see <a href="shell-builtin-commands">Shell Builtin Commands</a>). The positional parameters are temporarily replaced when a shell function is executed (see <a href="shell-functions">Shell Functions</a>). </p> <p>When a positional parameter consisting of more than a single digit is expanded, it must be enclosed in braces. </p><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/Positional-Parameters.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Positional-Parameters.html</a>
</p>
</div>
|