title: How to execute tcl script from php page and retrive the output back
body: <p>My project requires where i need to generate a front end (php) which has all the data input fiels. And using those data as input, I need to execute a TCL script. Once the execution is done, the php page should be able to get the output of the TCL script and show it.</p>
  
  <p>I have generated a sample script but not able to execute it.
  can you guys please help me.</p>
  
  <p>Thanks in advance</p>
  
  <p>My php script is:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;?php
              function print_procedure ($arg) {
                  echo exec("/usr/bin/tclsh /test.tcl");
              }
              $script_name='test.tcl';
              print_procedure($script_name);
          ?&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My TCL script is:</p>
  
  <pre><code>set a 10
  set b 20
  set c [expr $a + $b]
  return c
  </code></pre>