while
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_04_09
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_09
code:sh(bash)
while 条件
do
# 処理
done
do から done は ';' を付けてつなげる事ができる。
シェルスクリプトには範囲コメントがない事に注意
code:sh(bash)
while 条件; do 処理; done
条件
はコマンドで、コマンドが終了ステータス0を返すと真
無限ループしたい場合は、条件に
:
を使うことができる。
code:infinity_loop.sh
while :; do printf "BABEL "; done