LoginSignup
40

More than 5 years have passed since last update.

たまに見かける[Y/n]での分岐処理のサンプル

Last updated at Posted at 2012-10-26
#!/bin/bash

echo "こちらでよろしいですか? [Y/n]"
read ANSWER

case $ANSWER in
    "" | "Y" | "y" | "yes" | "Yes" | "YES" ) echo "YES!!";;
    * ) echo "NO!!";;
esac

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
40