/usr/bin/bash: Difference between revisions

Line 768: Line 768:


=== Arithmetic Expansion ===
=== Arithmetic Expansion ===
      Arithmetic expansion allows the evaluation of an arithmetic expression and  the  substitution  of
算術展開は、算術式の評価と結果の置換を可能にする。 算術展開の書式は以下の通りである:
      the result.  The format for arithmetic expansion is:


              $((expression))
<code>$((expression))</code>


      The old format $[expression] is deprecated and will be removed in upcoming versions of bash.
旧形式の<nowiki>$[expression]</nowiki>は非推奨であり、次期バージョンのbashでは削除される予定である。


      The  expression  is  treated  as  if  it were within double quotes, but a double quote inside the
式は二重引用符の中にあるものとして扱われるが、括弧の中の二重引用符は特別に扱われない。 式中のすべてのトークンは、パラメータと変数の展開、コマンドの置換、引用符の除去を受ける。 その結果は、評価される算術式として扱われる。 算術展開は入れ子にすることができる。
      parentheses is not treated specially.  All tokens in the expression undergo parameter  and  vari‐
      able expansion, command substitution, and quote removal.  The result is treated as the arithmetic
      expression to be evaluated.  Arithmetic expansions may be nested.


      The evaluation is performed according to the rules listed below under ARITHMETIC EVALUATION.  If
評価は、以下の[[#ARITHMETIC EVALUATION|ARITHMETIC EVALUATION ]]のルールにしたがって実行される。  式が無効な場合、bashは失敗を示すメッセージを表示し、置換は行われない。
      expression is invalid, bash prints a message indicating failure and no substitution occurs.


=== Process Substitution ===
=== Process Substitution ===