全文検索:
- 01 Bash - 制御文
- sh <code> #!/bin/sh echo -n "Please enter Yes or No _" read RESPONSE case $RESPONSE in [Yy]... es." ;; [Nn][Oo]) echo "You ansered No." ;; *) echo "Please enter Yes or No." ;; esac </code> 実行例 <code console> $ ./case_test02.sh Please enter Yes or No _Yes You ansered Yes. $ ./case_test02.sh Please
- 06 応答で処理を分岐する @bash:script
- lear ;; q|Q) exit ;; *) echo "No such number.";; esac done </code> ・実行結果 <code