title: evaluating an expression to true in a if statement with Tcl
body: <p>I'm having serious biggies trying to figure out how to evaluate an expression in a If statement using Tcl. This is what I have:</p>
  
  <pre><code>#!/bin/sh
  #The next line executes wish - wherever it is \
  exec wish "$0" "$@"
  
  set apid "/var/run/apache2.pid"
  
  set apsta [file exist $apid]
  
  if { $apsta == 1 }
  
  {
      set result ":)"
  }
  
  else
  
  {
      set result ":("
  }
  
  label .status -text $result
  pack .status
  </code></pre>
  
  <p>and this is what I get from the terminal:</p>
  
  <pre><code># wan27
  Error in startup script: wrong # args: no script following " $apsta == 1 " argument
      while executing
  "if { $apsta == 1 }"
      (file "/usr/bin/wan27" line 9)
  </code></pre>
  
  <p>I'm just trying to output a happy smiley if Apache is running, a sad one if Apache is stopped - based upon the boolean condition whether or not the file "/var/run/apache2.pid" exists ...</p>