Originally posted by Jeff Jakobowski
set errCode [catch {exec sh -c "$cmd > $tempfile 2>&1"} errMsg]puts -nonewline [read_file $tempfile]