#navi(../)

* シェルで無限ループ [#b8a4488f]

シェルスクリプトで無限ループを記述する方法を以下に記します。
bash、[[ash>http://ja.wikipedia.org/wiki/Almquist_Shell]]で動作確認を行いました。

#contents

#br
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)

* while : で無限ループ [#n5786212]
whileの後にある'':''はヌルコマンドといいます。
何も処理をせず、真を返却します。

 while :
 do
   処理
 done


* while true で無限ループ [#p54fc512]
'':''(コロン)の代わりに''true''と書くこともできます。

 while true
 do
   処理
 done

#br
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
#br

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS