Running BASH script from TCL



Hi,

I've a TCL script which generates some more TCL scripts (e.g. scr1.tcl
to scr5.tcl).
I've an application (my_app.exe) which executes these generated TCL
script.
For doing this I've written the following code:

proc runScripts { } {
set tclScriptFileList [exec ls scr*.tcl]
set tclScriptFileCount [llength $tclScriptFileList]
set count 1

while { $count <= $tclScriptFileCount } {
set tclFileName "./scr$count.tcl"
exec my_app -tclFile $tclFileName
incr count
}
}

This procedure when called executes the appication for the first
script and then hangs. And hence I'm not able to execute all the
generated scripts one after the other.

Can you suggest some solution for this???

As a woraround, I wrote the same procedure in BASH script and it
executes well. But I'm not able to execute it from the TCL script.

Please advise on the same...

Thanks and Best Regards
Adi (adichand@xxxxxxxxx)
.


Quantcast