記号・演算子
括弧
[]
:角括弧 (brackets) –test
コマンドと同意義 (条件式を評価する)[[]]
:二重角括弧 (double brackets) – 条件式を評価する (test コマンドより拡張されている)()
:丸括弧 (parentheses) – コマンドをサブシェルで実行する(())
:二重丸括弧 (double parentheses) – 算術計算式を評価する{}
:波括弧 (curly braces) – 一連のコマンドをカレントシェルで実行する${}
:ドルマーク+波括弧 (dollar sign + curly braces) – 変数展開 (parameter expansion){foo,bar}
/{00..10}
:波括弧 (curly braces) – ブレース展開 (brace expansion)func () {}
:関数の定義
参考:
シェルスクリプトにおける丸括弧「()」 角括弧「[]」 波括弧「{}」の使い方 | hosii のメモ帳
bash の括弧やコロンについて | KentaKomai Blog
How to use double or single brackets, parentheses, curly braces – Stack Overflow
Command Grouping – Bash Reference Manual | gnu.org
What’s the use of parentheses `()` in shell function definition? – Ask Ubuntu
グルーピング
参考:
bash で中括弧のグループコマンドをパイプでつなぐとサブシェルで実行されるので一応気をつける | 上田ブログ
Command Grouping | Bash Reference Manual (gnu.org)
How are parentheses interpreted at the command line? – Unix & Linux Stack Exchange
ブレース展開
参考:
bash の brace expansion で for 文を使いこなせ!- Qiita
bash のブレース展開を使ってカンマ区切りリストを作る | 双六工場日誌
Bash Brace Expansion | Linux Journal
6 Examples of Expanding Expressions within Braces | The Geek Stuff
Brace expansion | Bash Hackers Wiki
Brace Expansion | Bash Reference Manual (gnu.org)
How does curly brace expansion work in the shell? – Unix & Linux Stack Exchange
ブレース展開で変数を使う
参考:
Brace expansion in scripts not working due to unwanted escaping – Stack Overflow
Tricky brace expansion in shell – Stack Overflow
Understanding bash brace expansion – Stack Overflow
特殊文字
参考:
Special Characters – Advanced Bash-Scripting Guide | The Linux Documentation Project
$*
参考:
$* – Internal Variables | Advanced Bash-Scripting Guide (tldp.org)
$@
参考:
$@ – Internal Variables | Advanced Bash-Scripting Guide (tldp.org)