Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- invalid command name "
- while executing
- ""r""
- invoked from within
- "expect {
- -ex "--More--" {send -- " "; exp_continue}
- "*>" {send "exit r";"r"}
- }"
- (file "./scriptprueba4.sh" line 12)
- #!/usr/bin/expect -f
- #!/bin/sh
- set DATE [exec date +%F]
- spawn telnet 111.111.1.111
- expect "Username:"
- send "userr"
- expect "Password: "
- send "this.is.the.passr"
- expect "*>"
- send "show cdp neighbors r"
- log_file -noappend CDP.dat
- expect { #this is the part i just modified and caused the error.
- "More--" {send " "; exp_continue}
- ">" {send "exit r"; "r"}
- }
- expect "$ " #I want this part of the code to be executed after "$" but the script stops before doing it
- send "tail -n+6 CDP.dat > CDP2.datr"
- expect "$ "
- send "./primeros3.sh r"
- expect "$ "
- send -- "tr -d '\r' < CDPyPuerto.dat | awk '{ printf "%s %s", $0, (length($1) > 16) ? OFS : ORS}' > TablaCDP.dat r"
- expect "$ "
- expect {
- "More--" {send " "; exp_continue}
- ">" {send "exit r"; "r"}
- }
- #!/usr/bin/expect -f
- #!/bin/sh
- set DATE [exec date +%F]
- spawn telnet 148.228.4.199
- expect "Username:"
- send "primer"
- expect "Password: "
- send "no.soy.de.redesr"
- expect "*>"
- send "show cdp neighbors r"
- log_file -noappend CDP.dat
- expect -ex "--More--" {send -- " "; exp_continue}
- expect "*>"
- send "exit r"
- expect "$ "
- send "tail -n+6 CDP.dat > CDP2.datr"
- expect "$ "
- send "./primeros3.sh r"
- expect "$ "
- send -- "tr -d '\r' < CDPyPuerto.dat | awk '{ printf "%s %s", $0, (length($1) > 16) ? OFS : ORS}' > TablaCDP.dat r"
- expect "$ "
- send: spawn id exp4 not open
- while executing
- "send "tail -n+6 CDP.dat > CDP2.datr""
- (file "./scriptprueba4.sh" line 16)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement