Reputation: 51
i was sourcing a tcl script file and could not pass the parameter. ie.
source test.tcl param1 param2
where in test.tcl
, it uses param1
and param2
to print as string
Note: I need to source tcl script only.. Not any other
puts "param1 : $1"
puts "param2 : $2"
Upvotes: 1
Views: 355
Reputation: 5733
You can set argv
:
set origargv $::argv
set ::argv [list -param1 x -param2 y]
source myscript
The sourced script can access the parameters from argv
as usual.
Upvotes: 2