title: Problems understanding TCL CATCH exec issue
body: <p>Got a problem thats being doing my head in for the last 2 days.</p>
  
  <p>Im running a tcl script (for an eggdrop) which when triggered, executes a local shell command (child process) and if the command is succesfull it spits out the results. However, if the command is NOT succesful, i get an error "<code>Tcl error [proc_ports]: child process exited abnormally</code>:.</p>
  
  <p>What i would like is to create a custom response, if the child process did not find any results.</p>
  
  <p>The script is:</p>
  
  <pre><code>set chan "#help"
  bind pub -|- .port proc_ports
  
  proc proc_ports {nick host handle channel testes} {
      global chan
      if {"$chan" == "$channel"} {
          return 0
      }
  
      if [matchattr $nick |fmn $channel] {
          set ports [lindex $testes 0]
          set fp [ exec grep -w "$ports" scripts/ports | awk {{$1=""; print $0}} ]
  
          putserv "PRIVMSG $channel :Port \002$ports\002 is normally used for: \002$fp\002"
  
          return 1
      } else {
          putserv "PRIVMSG $channel :$nick, you do \002NOT\002 have access to this command!"
          return 1
      }
  }
  </code></pre>
  
  <p>I would love to solve this using TCL, to help me learn more, rather than changing the exec into a shell script that would return any errors.</p>
  
  <p>I have read up on the CATCH command in TCL, and have tried many different approaches to the script, however all have failed me :(</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Cheers.</p>