close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #1118: tclexec.tcl

File tclexec.tcl, 319 bytes (added by Jorge, 13 years ago)
Line 
1proc ::tclexec { cmdline } {
2  set ::errorCode NONE
3  set ::errorInfo {}
4  set rc [ catch { eval exec $cmdline } msg ]
5  set ei [ string map [list \" \\\"] $::errorInfo ]
6  set out [ string map [list \" \\\"] $msg ]
7  return \[\[Text\ errorCode=\"$::errorCode\",Text\ errorInfo=\"$ei\",Text\ Output=\"$out\"\]\]
8}