expect script debugging
Add the "-d" switch.
#!/usr/bin/expect
I have a problem writing something to a telnet session:
send: sending "status\n" to { exp6 }
send: sending "quit\r" to { exp6 }
write() failed to write anything - will sleep(1) and retry...
The solution for my telnet script was to add the "interact" command after the statements you want sent to the session:
send quit\r\n
interact
#you need interact otherwise the command won't get sent
debuggingexpect, debugging, quot, usr, bin, telnet, exp, retry, interact, statements,