
一下是该脚本在vim里的原状态,前面的是行号
1 #!/bin/bash
2 # Program:
3 # This program shows users' choice
4 # History:
5 # 2010/05/06 Ricardo First release
6 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
7 export PATH
8 read -p "please input Y or N:" x #用户输入Y或N
9 if [ "$x" == Y ] || [ "$x" == y ] ; then
10 echo "OK,continue"
11 exit #判断输入值是否Y或y
12 if [ "$x" == N ] || [ "$x" == n ] ; then
13 echo "Oh,interrupt!"
14 exit #判断输入值是否N或n
15 fi
16 echo "I don't konw what your choice is " && exit