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!

How to excecute a script with TCL

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hello,

I am new Tcl user and I am trying to execute an AWK or Cshell script from within a Tcl script.

I have tried:
set test = Eval[$scriptname < $inputdataname]

but this does not work. How can I store the result of scriptname < inputdataname (will output some text) into test?

THanks for your help.



 
hi fabien..

Couple of ways you can possibly do this:
One way is via process pipes, and open the process
as you would a file or socket if that is called for.

set XX [open &quot;| awk -F scriptname&quot;]

to just retrieve the output of the script run:

set XX [exec scriptname]
This is probably what you are looking for .

To just execute the script form within the tclsh..
either exec scriptname as above, or system scriptname
will work.
 
thanks a lot marsd, the second solution worked fine!

Fabien
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top