- 論壇徽章:
- 1
|
本帖最后由 wind_133 于 2015-10-20 17:11 編輯
用expect自動登陸另一臺設(shè)備,登陸后提示符是$,好像無法識別。誰給支個(gè)招,謝謝了。
expect: spawn id exp4 not open
while executing
"expect $ "
(file "./test.sh" line 13)
腳本內(nèi)容如下:
#!/usr/bin/expect -f
set acct_path /dse_data/log/ae
set shouji [lindex $argv 0]
set date [lindex $argv 1]
set num [lindex $argv 2]
set timeout 10
spawn ssh bap@192.168.1.1
expect {
#"*yes/no" { send "yes\r"; exp_continue}
"*:" { send "123456\r" }
}
interact
expect $ //這里$加上""也不行,"\$ "也不行
send "cd /export/home/\r" |
|