当前位置: 技术问答>linux和unix
请问如何在expect脚本中实现变量比较?
来源: 互联网 发布时间:2016-01-10
本文导语: 现在有一脚本,是用expect登陆到一主机上. 需要根据var1的值来决定不同的输出 #!/usr/bin/expect spawn /usr/bin/telnet 10.123.123.123 expect "login:" send "gmccr" expect "word:" send "abcdefr" expect "@" send "var1=`输入命令`r "
现在有一脚本,是用expect登陆到一主机上.
需要根据var1的值来决定不同的输出
#!/usr/bin/expect
spawn /usr/bin/telnet 10.123.123.123
expect "login:"
send "gmccr"
expect "word:"
send "abcdefr"
expect "@"
send "var1=`输入命令`r "
需要根据var1的值来决定不同的输出
#!/usr/bin/expect
spawn /usr/bin/telnet 10.123.123.123
expect "login:"
send "gmccr"
expect "word:"
send "abcdefr"
expect "@"
send "var1=`输入命令`r "