Reputation: 33
I have 3 C programs (prog1, prog2, prog3) that I want to call from Tcl. But they have some dependencies :
So , some pseudo code to show what I want to achieve.
(prog1 ; prog2) &
prog3
How can I do it in TCL ?
Upvotes: 1
Views: 223
Reputation: 33
The following solution work fine for me:
exec sh -c "prog1; prog2" &
exec prog3
Upvotes: 1
Reputation: 5763
First create a helper script to run prog1 and prog2 (this could be a premade script instead of creating it dynamically):
set fh [open prog1prog2.tcl w]
puts $fh {exec prog1}
puts $fh {exec prog2 &}
close $fh
Then run the script:
exec [info nameofexecutable] prog1prog2.tcl &
exec prog3
If you don't need to wait for the programs to finish, the last exec can have an ampersand appended.
Upvotes: 0