expect怎么加上判断语句
发表于 : 2009-11-18 17:21
代码: 全选
#!/usr/bin/expect -f
spawn sudo chmod -R u+s /Applications/Utilities/Adobe\ AIR\ Application\ Installer.app
set timeout 20
expect "Password:"
send "54321\r"
expect eof"
#end
但是如果屏幕没有Password就会出现错误提示
代码: 全选
send: spawn id exp7 not open
while executing
"send "54321\r""
(file "/Users/onlinenmg/Desktop/234.sh" line 7)