Forum OpenACS Development: How to execute a tcl script with args?? URGENT PLEASE!!

Hello i'm new on tcl scripting and i don't know how to execute a script with args, i always receive this message:

Wron # args should be: "Source FileName"

And i think that it is by a bad syntax i Just type:

(in a tclsh)

souce script.tcl -arg1 value -arg2 value -arg3 value

I'll be waiting for help..

thank you.!!

Hello Kenneth,
  Here is the documentation for TCL's source command: http://www.tcl.tk/man/tcl8.4/TclCmd/source.htm  As you can see, it doesn't pass arguments to the script.  If you only need this functionality in tclsh, something like this might work:

proc mysource {script args} {
    set l [list exec [info nameofexecutable] $script]
    set l [concat $l $args]
    return [eval $l]
}

mysource script.tcl arg1 arg2 arg3

Or see http://wiki.tcl.tk/10025 for another method.
  However, if you are using OpenACS / AOLserver this might not have the effect you expect.  If that's the case, please let us know more about what you're trying to accomplish.

thank you for your reply but, i'm completly new on tcl sorry, where do i have to write the code of this procedure?? in a file?

I need to execute this script in a tcsh, but i doesn't work.

help me please.

thank you again.

tcsh (the Enhanced/Tenex C Shell) and tclsh (the Tcl shell) have nothing to do with each other.
Please tell us more:
* What operating system are you using? What version?
* How and where did you install TCL? What version?
* Where did the script you are trying to execute come from? What args does it expect and what is it supposed to do?

If I understood your question, you have an existing TCL program (that you did not write) in one file, and you want to execute it from a TCL program in another file that you are writing. Is that correct?

hi!
Thank you.

I'm in a Pentium III 866Mhz 512MB ram with Windows XP professional Service pack 2 ver 2002.

to exectute those tcl scripts i'm trying some tcsh shells, downloaded from www.

I have one shell in a simple file, like tcsh.exe.
I have downloaded Active TCL (tclsh 8.4), cygwin, and a tcsh from a languaje study suite called CSLU tool kit.
I used a tcsh in RedHat linux 8.0 and it's the same thing.

The scripts come from a web site:

http://info.pue.udlap.mx/~sistemas/tlatoa/howto/techdoc.html

who uses tcl for making software for voice synthensis and recognition. This es a group called "tlatoa" from mexico who have developed those scripts for create and labeling .wav files to make a "voice corpus" (little voice units) needed to make a voice synthesis system. I have already tryied to get in touch with this guys but no answer.

I hope you could help me.

I think these scripts have to be executed in a tcsh, because in a document from this site someone wrote that he uses a tcsh for it.

Thank you again and sorry for my english.

kenneth

I forget to say i think that the shell included in the CSLU tool kit should work with this scripts, because this people (tlatoa people) have developed some software that works with CSLU.

Probably they use it, I think syntax errors.

to check the syntax of the scripts look at this link (Example Usage Section):

http://info.pue.udlap.mx/~sistemas/tlatoa/howto/make_recognizer.html

here you can see the script:

make_recognizer.tcl -name alfa1 -corpus alfa1 -sampling_rate 8000

and its args.

thank you again.

kenneth

Thank you for the information, that helps. I did misunderstand your question. As Andy said, tcsh != tclsh. To run a TCL script, you usually want to use tclsh. (If I'm not mistaken, this document does refer to running scripts from tcsh, but I don't know that that is necessary.)

If you installed ActiveTcl in its default location, you should have the file C:\Tcl\bin\tclsh84.exe. Try installing the TCL packages from tlatoa.zip in C:\Tcl\lib\tlatoa. This makes them available to the scripts that require those packages.

It sounds like you can put the files from scripts.zip anywhere. Perhaps you put them in C:\source\tlatoa\. Then, from a Windows cmd.exe prompt, run something like: C:\Tcl\bin\tclsh.exe C:\source\tlatoa\make_recognizer.tcl -name alfa1 -corpus alfa1 -sampling_rate 8000
You may not even have to specify the path to tclsh.exe, depending on how your Windows file extension associations are configured, but for now, be explicit.

This should run and give you some output. (I get an error when I run it, but I assume that's because I didn't bother downloading the vocab and parts files.) Note that I don't see on their website what platforms they test this software on, it is possible it won't work properly on Windows, though TCL is mostly platform-independent.

By the way, if you aren't using AOLserver or OpenACS, a better place to ask TCL questions is the comp.lang.tcl newsgroup. You will probably get faster answers to general TCL questions there.

Thank you so much. It works !!

the "TLC" command at those scripts, it is just the name of the executable file of the shell.

thank you

Collapse
Posted by Kos Zios on
Have you solved your problem?
i have a problem too.. i use args but some times in the script
appears { } that i do not want them...they appear because of the "args" any idea to get rid of them?