Shell Script 询问使用者 Yes/No


很多时写 Shell Script 都需要使用者确认动作, 然后询问 yes 或者 no, Shell Script 里面可以这样写:

Bash 3.2 或以上版本可以这样写:

Bash 4.x 这样写:

One Response

  1. Gary 06 February 2018

Leave a Reply