0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

シェルスクリプト case文

Posted at

case $var in #$varはチェックする変数
 パターン1) #$varがパターン1に該当する場合に実行される
  プログラム1;;
 パターン2) #$varがパターン2に該当する場合に実行される
  プログラム2;;
 *) #$varがパターン1にもパターン2にも該当しない場合に実行される
  プログラム3;;
esac

パターンの記載方法
[a-z]:a-zまでの場合
[A-Z]:A-Zまでの場合
[0-9]:0-9までの場合

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?