关于expect的问题?

关于expect的问题?

我要做一个运行keytools时自动录入信息的脚本, 可是到最后一步时, 却总是不录入不能自动录入yes就结束了. 哪位高手帮我看一看,先行谢过了!
[root@linuxdb /disk21/home/officer]#mmms
spawn keytool -genkey -alias hanbai -keypass hanbai
Enter keystore password: hanbai
What is your first and last name?Lianghongyu

[Unknown]: What is the name of your organizational unit?Development

[Unknown]: What is the name of your organization?Panabright

[Unknown]: What is the name of your City or Locality?Dalian

[Unknown]: What is the name of your State or Province?Liaoning

[Unknown]: What is the two-letter country code for this unit?JP

[Unknown]: Is CN=Lianghongyu, OU=Development, O=Panabright, L=Dalian, ST=Liao
ning, C=JP correct?
[no]: [root@linuxdb /disk21/home/officer]#

我的脚本如下:
#!/usr/bin/expect

spawn keytool -genkey -alias hanbai -keypass hanbai

expect "Enter keystore password:" {
send "hanbai\r"
}
expect "What is your first and last name?" {
send "Lianghongyu\r"
}
expect "What is the name of your organizational unit?" {
send "Development\r"
}
expect "What is the name of your organization?" {
send "anabright\r"
}
expect "What is the name of your City or Locality?" {
send "Dalian\r"
}
expect "What is the name of your State or Province?" {
send "Liaoning\r"
}
expect "What is the two-letter country code for this unit?" {
send "JP\r"
}
expect "\[yes\]:" {
send "yes\r"
}
expect "\[no\]:" {
send "yes\r"
}

exit 0      
哪位大哥知道,在LINUX怎么双击就可以自动在终端运行吗?      
shell提示里没有出现\[yes\]或者\[no\],所以就中断了