shellScript学习02--判断指令test和[]( 二 )


shellScript学习02--判断指令test和[]

文章插图
#!/bin/bash#用户输入y继续,n结束,其他输出不知道#xie#2018年5月17日14:11:03read -p "are you a pig? y/n :" choice[ $choice == "y" -o $choice == "Y" ] && echo "yes,you are pig" && exit 0[ $choice == "n" -o $choice == "N" ] && echo "you not a man" && exit 0echo "you are pig,what you type?!" && exit 0
参考文献:鸟哥的linux私房菜