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

pass an arg to a tcl script, which itself is called by a binary

Status
Not open for further replies.

johnsbn

Technical User
Mar 23, 2010
12
0
0
US
I need to pass an argument to the tcl from command line (this is done by a make target)

But I cannot run this script using tclsh. I have to source this file as a command line option of a binary file.

So when I do this,
home/bin/abc -do my.tcl ARG
binary errors out as it has an illegal option. Fair enough.

What other way can I pass this arg to the tcl script?

I can set the arg as an env variable in the makefile and read it from inside the tcl script. But this is not a proper soln, as I don't want to mess with env variables.

Any suggestions? Your help is much appreciated.
 
Hi

I would try two things, but both depend on that abc. ( By the way, there is no documentation for abc ? )

Add -- after the abc's parameters :

[tt]home/bin/abc -do my.tcl [red]--[/red] ARG[/tt]

Add ' around the script and its parameters :

[tt]home/bin/abc -do [red]'[/red]my.tcl ARG[red]'[/red][/tt]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top