+ -
当前位置:首页 → 问答吧 → 删除 C语言注释

删除 C语言注释

时间:2009-11-18

来源:互联网

代码:
#!/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:就会自动输入密码

但是如果屏幕没有Password就会出现错误提示

代码:
send: spawn id exp7 not open
    while executing
"send "54321\r""
    (file "/Users/onlinenmg/Desktop/234.sh" line 7)


怎么加上判断语句,如果没有Password,就不执行后面的步骤

作者: 木泥黑   发布时间: 2009-11-18



代码:
#!/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"; exp_continue}
}
exit
#end

作者: 木泥黑   发布时间: 2009-11-18

楼主威武

作者: poseidon88   发布时间: 2011-11-11