title: How to check if a variable is set in expect script?
body: <p>I am doing something like this:</p>
  
  <pre><code>#!/usr/bin/expect -f
  
  if {$out != ""} {
    send_user $out
  }
  </code></pre>
  
  <p>But it doesn't work. Error message:</p>
  
  <pre><code>can't read "out": no such variable
      while executing
  "if {$out != ""} {
  send_user $out
  }"
      (file "./test" line 3)
  </code></pre>