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

How to Execute a Tcl script from a C Program?

Status
Not open for further replies.

fox12

Programmer
Jan 18, 2005
62
0
0
US
I have a tcl script to be called within a C program. I use the system(tcl_script_file) to execute it. The call returns successfully, but the script is never executed. What is the right way to run a Tcl script from within a C program. By the way, the script will take in one argument. I run the script manually, and it works fine.

Here is the code segment:

int status;
sprintf(cmdstr, "/export/home/user9/trans/file.tcl %s", filename);
status = system(cmdstr);
//status always equals to 0, meaning the execution is successful.

Is that right to run a tcl script? If not, what is the right way to do this?

Thanks a ton!!!

Fox12


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top