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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

background exec problem

Status
Not open for further replies.

xavier64

Technical User
Nov 18, 2002
12
FR
Hello,

i'm running an exec command in background cause it's quite long.

set error_code [catch {eval exec $command &} result]

How can i know when it's finish ???

merry xmass,

Xav
 
Maybe by creating a report file at the end of the run and watching for it?

HTH

ulis
 
Another way is to use a trace on a variable
or on a procedure though it takes a little bit
of experimentation to get this to work, I have used
it with some success.

 
Well, a couple of ideas come to mind. If you can use the Blt extension, it provides a bgexec command that is very well suited to this type of situation. Otherwise, about the only other reasonable way to do it in pure Tcl is to start the other program via a pipe, and then read the output of the program through the pipe. Once the program is finished, you'll get an EOF notification on the pipe.

For more information about these techniques, consult the Tcl'ers Wiki, The bgexec command is discussed briefly on the page "bgexec," and the Blt extension is described on the page "BLT," You can start learning about pipes at "pipeline," "Pipes vs Expect," also has some good information about this. - Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top