title: Expect script error missing close-brackets
body: <p>Hi here is my expect script:</p>
  
  <pre><code>#!/usr/local/bin/expect -f
  set force_conservative 0  ;# set to 1 to force conservative mode even if
                            ;# script wasn't run conservatively originally
  if {$force_conservative} {
          set send_slow {1 .1}
          proc send {ignore arg} {
                  sleep .1
                  exp_send -s -- $arg
          }
  }
  
  set timeout -1
  spawn $env(SHELL)
  match_max 100000
  send -- "ssh IP_addr\r"
  expect -exact "password: "
  send -- "something\r"
  expect -exact "\r"
  #expect -exact "Entering server port, ..... type ^z for port menu."
  send -- "\r"
  expect -exact "login: "
  send -- "admin\r"
  expect -exact "password: "
  send -- "something\r"
  expect -exact "something &gt; "
  send -- "reboot\r"
  expect -exact "REBOOT THE SYSTEM? (y or n): "
  send -- "y\r"
  expect -exact "SYSTEM REBOOTING!\r"
  set no 20
  for {set i 1} {$i &lt; $no} {incr i 1} { 
      send -- "^[-"   
  }
  expect -exact "\/----Enter Password----\\"
  expec eof
  </code></pre>
  
  <p>I want to send escape and hyphen character multiple times until I receive "/----Enter Password-----\ prompt. But I'm receiving following error at this line:</p>
  
  <pre><code>missing close-bracket
              while executing
          "'send -- "^[-"'
          "
              ("for" body line 2)
              invoked from within
          "for {set i 1} {$i &lt; $no} {incr i 1} {
                  'send -- "^[-"'
          }"
              (file "script_auto.exp" line 31)
  </code></pre>
  
  <p>I'm newbie to expect. Kindly let me know what does that error mean and how can I resolve it. </p>