mirror of https://github.com/tLDP/LDP
181 lines
5.1 KiB
XML
181 lines
5.1 KiB
XML
<table>
|
|
<title>Operator Precedence</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Operator</entry>
|
|
<entry>Meaning</entry>
|
|
<entry>Comments</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><option></option></entry>
|
|
<entry></entry>
|
|
<entry><command>HIGHEST PRECEDENCE</command></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>var++ var--</option></entry>
|
|
<entry>post-increment, post-decrement</entry>
|
|
<entry><link linkend="cstyle">C-style</link> operators</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>++var --var</option></entry>
|
|
<entry>pre-increment, pre-decrement</entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>! ~</option></entry>
|
|
<entry><link linkend="notref">negation</link></entry>
|
|
<entry>logical / bitwise, inverts sense of following
|
|
operator</entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>**</option></entry>
|
|
<entry><link
|
|
linkend="exponentiationref">exponentiation</link></entry>
|
|
<entry><link linkend="arops1">arithmetic
|
|
operation</link></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>* / %</option></entry>
|
|
<entry>multiplication, division, modulo</entry>
|
|
<entry>arithmetic operation</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>+ -</option></entry>
|
|
<entry>addition, subtraction</entry>
|
|
<entry>arithmetic operation</entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option><< >></option></entry>
|
|
<entry>left, right shift</entry>
|
|
<entry><link linkend="bitwsops1">bitwise</link></entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>-z -n</option></entry>
|
|
<entry><firstterm>unary</firstterm> comparison</entry>
|
|
<entry>string is/is-not <link
|
|
linkend="stringnull">null</link></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>-e -f -t -x, etc.</option></entry>
|
|
<entry><firstterm>unary</firstterm> comparison</entry>
|
|
<entry><link linkend="fto">file-test</link></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>< -lt > -gt <= -le >= -ge</option></entry>
|
|
<entry><firstterm>compound</firstterm> comparison</entry>
|
|
<entry>string and integer</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>-nt -ot -ef</option></entry>
|
|
<entry><firstterm>compound</firstterm> comparison</entry>
|
|
<entry>file-test</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>== -eq <link linkend="notequal">!=</link>
|
|
-ne</option></entry>
|
|
<entry>equality / inequality</entry>
|
|
<entry>test operators, string and integer</entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>&</option></entry>
|
|
<entry>AND</entry>
|
|
<entry>bitwise</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>^</option></entry>
|
|
<entry>XOR</entry>
|
|
<entry><firstterm>exclusive</firstterm> OR, bitwise</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>|</option></entry>
|
|
<entry>OR</entry>
|
|
<entry>bitwise</entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>&& -a</option></entry>
|
|
<entry>AND</entry>
|
|
<entry><link linkend="logops1">logical</link>,
|
|
<firstterm>compound</firstterm>
|
|
comparison</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>|| -o</option></entry>
|
|
<entry>OR</entry>
|
|
<entry>logical, <firstterm>compound</firstterm>
|
|
comparison</entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>?:</option></entry>
|
|
<entry><link linkend="cstrinary">trinary
|
|
operator</link></entry>
|
|
<entry>C-style</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>=</option></entry>
|
|
<entry><link linkend="eqref">assignment</link></entry>
|
|
<entry>(do not confuse with equality
|
|
<firstterm>test</firstterm>)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>*= /= %= += -= <<= >>= &=</option></entry>
|
|
<entry><link linkend="arithopscomb">combination
|
|
assignment</link></entry>
|
|
<entry>times-equal, divide-equal, mod-equal, etc.</entry>
|
|
</row>
|
|
<row>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
<entry></entry>
|
|
</row>
|
|
<row>
|
|
<entry><option>,</option></entry>
|
|
<entry><link linkend="commaop">comma</link></entry>
|
|
<entry>links a sequence of operations</entry>
|
|
</row>
|
|
<row>
|
|
<entry><option></option></entry>
|
|
<entry></entry>
|
|
<entry><command>LOWEST PRECEDENCE</command></entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|