title: how to wait for an output in TCL command before running the next command
body: <p>Situation is that I need to invoke a tool using some command and when the tool completes the run , it produces exit 0 status. More precisely it says the following:</p>
  
  <blockquote>
    <p>EXIT STATUS 0</p>
  </blockquote>
  
  <p>I want to use this exit status 0 to execute my next commands. I mean that I want to wait until tool run is complete and exit 0 status returned. Pseudo code bellow:</p>
  
  <pre><code>run this tool command  
  wait until exit 0 status is generated by above command&gt;    
  do the following     
  </code></pre>
  
  <p>Actual Code.</p>
  
  <pre><code>     @run           {incr i ; set ET_WORKDIR [lindex $argv $i]
                     set COPY_ET_WORKDIR "exec cp -pRf ${ET_WORKDIR} ET_WORKDIR"
                     puts "Copying the ${ET_WORKDIR} inside $env(PROJECT_WDIR_PATH) workarea"
                     eval $COPY_ET_WORKDIR
                     set run_et "exec et -e  $env(PROJECT_WDIR_PATH)/ET_WORKDIR/runet.atpg &amp;"
                     lsc_msg "I" "ATPG analysis has been started!!!"
                     eval  $run_et
  
    if [info exist EXIT STATUS 0]  
  {set setup "exec mkdir $env(PROJECT_WDIR_PATH)/logs/${logdate}"
   eval $setup
   set setupcopy "exec cp -pRf $env(PROJECT_WDIR_PATH)/ET_WORKDIR/testresults/logs/* $env(PROJECT_WDIR_PATH)/logs/$logdate/."
                     eval $setupcopy
                      exit 0
                       }
  }
  </code></pre>