請問 各位高手
小弟使用DES-3326SR的機器 想要telnet進去機器裡
我想給它這指令 show mirror
例如:sudo ./file.sh show mirror
程式要怎麼去做修正還有參數該怎麼下才對呢
煩請告知 謝謝
#!/usr/bin/tclsh
package require Expect
spawn telnet 10.90.90.90
expect "UserName:"
send "admin\r"
expect "Password:"
send "\r"
expect "*#"
send " $1\r"
expect "*#"
send "logout\r"
interact
它出現錯誤 can't read "1": no such variable
while executing
"set $1"
(file "./file.sh" line 9)
小弟使用DES-3326SR的機器 想要telnet進去機器裡
我想給它這指令 show mirror
例如:sudo ./file.sh show mirror
程式要怎麼去做修正還有參數該怎麼下才對呢
煩請告知 謝謝
#!/usr/bin/tclsh
package require Expect
spawn telnet 10.90.90.90
expect "UserName:"
send "admin\r"
expect "Password:"
send "\r"
expect "*#"
send " $1\r"
expect "*#"
send "logout\r"
interact
它出現錯誤 can't read "1": no such variable
while executing
"set $1"
(file "./file.sh" line 9)