Forum OpenACS Q&A: TCL command line argument is always glob style. How to change it?

I am doing programming with TCL language. But the argument in the command line seems always using glob style matching. This means each argument is always tried by the TCL interpreter to match with file names in current directory. But many times, I don't want to use the arguments as file name patterns. So the script gives wrong output. If the matching style is changed into exact or regexp depending on cases, then it will serve the purpose of what I need. How to change this?

Example: script.tcl /home/usr/tcl param*

The system is always trying to interpret /home/usr/tcl and param* as file or path matching patterns, or in other words, using glob style.
The argument is no longer param*, but becomes following several arguments:
param, param_1, param_log, while each one is a file name in current directory.

But in my script, the argument param* has nothing to do with file name. So the script cannot run correctly.
What's more, if there's no file matching such pattern, then the script even cannot run because of no match.

This is called glob style. How to change the command line argument interpreting from glob style into exact or regexp style?
If the style is changed correctly, then my script would work.

Thanks.

the command line globbing is not performed by tcl, but already by the shell you are using. Tcl "sees" only the already expanded arguments. In order to pass wildcards to the tcl shell, quote the arguments accordingly (e.g. 'param*').

btw, this is not the correct place to ask, you should consult http://groups.google.com/group/comp.lang.tcl/topics with purely tcl related questions.

Hi, Gustav:

I tried your proposal. Thank you that it works. Also thank you for the correct place to consult TCL questions.
I will apply for an account there, and post my new questions there in the future.

Best regards. 😊