|
照着书写的一段 可是当我输入一个结束后 输入n想结束时没效果仍然循环 不知道哪里出问题了 循环一直不停。。。
answer=y
while [ "$answer"=y ]
do
tput clear
tput cup 5 10;echo "UNIX Student - ${BOLD}ADD MODE"
echo "${NORMAL}"
tput cup 7 24;echo "NAME:"
tput cup 9 20;echo "NUMBERID:"
tput cup 11 20;echo "BIRTHDAY:"
tput cup 7 30;read name
tput cup 9 30;read numberid
tput cup 11 30;read birthday
echo "$name numberid birthday" >> ustu_file
tput cup 13 10; echo "Any more to add Yes or No>_\b\c"
read answer
case $answer in
[Yy]* ) answer=y ;; #不知道这句有错没??
* ) answer=n ;;
esac
done
exit 0
一次输入结束后 输入no都继续循环。。。。。。 |
|