Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Piping application output

Status
Not open for further replies.

clandestin

IS-IT--Management
Sep 20, 2005
4
0
0
DE
Hello,
I'm trying to start an application with a tcl proc and catch the output of that application into a file.

For now I could only manage to start it like this:

set output [catch { exec myprogram } ]
set output_file [open "$env(HOME)/.output.log" "w"]
puts $output_file $output
close $output_file

But this returns only a 0 or a 1 depending how the program exited.

Is there any other way to get the full output from my progam in file?

doing something like this won't work :

set output [catch { exec myprogram >> logfile} ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top