0

I have used the /usr/bin/expect interpreter to telnet into my other system and execute some commands using send.

Telnet is successful however the problem is that I have to use the following command

send "unset vpn "TEST" "

when I run the script, it shows me the following error due to " inside send command.

extra characters after close-quote while executing
sourav c.
  • 44,715
Waqas
  • 29
  • 1
  • 2

2 Answers2

4

You can use escape sequence, use the following,

send "unset vpn \"TEST\"\r"

or,

send {unset vpn "TEST"}
sourav c.
  • 44,715
  • Escaping the double quotes with a backslash did not work for me. The following code would throw the error "extra characters after close-quote": send "UPDATE table SET value = '<a href="someurl.org"> linktext ';" – emma Nov 15 '22 at 14:47
-1

Did you try send "unset vpn 'TEST' "?