求教!
发表于 : 2013-08-15 17:06
#!/bin/bash
#program:
# This program shows the user's choice
#History:
# 2013/08/15 lvyangjian firstrelease
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
read -p "please input (Y/N): " yn
[ "$yn" == "Y" -o "$yn" == "y" ] && echo "ok,continue" && exit 0
[ "$yn" == "N" -o "$yn" == "n" ] && echo "oh,interrupt" && exit 0
echo "I don't what your choice is " && exit 0
~
结果显示
sh06.sh: 10: [: Y: unexpected operator
sh06.sh: 11: [: Y: unexpected operator
I don't what your choice is
请问是哪里错了
#program:
# This program shows the user's choice
#History:
# 2013/08/15 lvyangjian firstrelease
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
read -p "please input (Y/N): " yn
[ "$yn" == "Y" -o "$yn" == "y" ] && echo "ok,continue" && exit 0
[ "$yn" == "N" -o "$yn" == "n" ] && echo "oh,interrupt" && exit 0
echo "I don't what your choice is " && exit 0
~
结果显示
sh06.sh: 10: [: Y: unexpected operator
sh06.sh: 11: [: Y: unexpected operator
I don't what your choice is
请问是哪里错了