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!

Executing a Tcl Script from a Tcl Script -- HELP!

Status
Not open for further replies.

cj3749

Technical User
Apr 24, 2002
1
US
I'm attempting to execute a Tcl Script from another Tcl script. However, I cannot get execution to return from the child script back to the parent script.

I'm also passing parameters into the child script. Right now I'm using the following syntax:

[exec cmd.exe /c script_name.tcl $arg1 $arg2 $arg3]

Also, I have tried running the child script from a shortcut to no avail.

The child script executes successfully, however, it is never destroyed. How can I destroy the child process when it's finished?

I'm really at my wit's end. Thanks in advance.




 
I don't get it. Why aren't you using {
set arg1 <whatever>
set arg2 <whatever>
set arg3 <whatever>
source script_name.tcl
}? Bob Rashkin
rrashkin@csc.com
 
You might be more successful in execing the tclsh interpreter, and passing your script as the first argument, which causes tclsh to automatically source that script when it starts. I've not had problems before with syntax like the following, even on Windows:

Code:
set output [exec tclsh myscript.tcl $arg1 $arg2]

Check to make sure that tclsh is actually the name of your interpreter. You might need the version number appended to the end (e.g., tclsh83). - Ken Jones, President
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