How to store a command line arguments in an array in tcl?
I'm trying to store command line arguments (argv) in an array. Is argv is not array? I tried the following code but doesn't work for me.
proc auto args {
global argv
set ifname [lindex $argv 0]
puts "***********$ifname"
puts "$argv(2)"
for { set index 1} { $index < [array size argv ] } { incr index } {
puts "argv($index) : $argv($index)"
}
}
#Calling Script with arguments
auto {*}$argv
arraydoes not mean array in other languages. Are you sure you want an array and not a list? Even if you're sure you want a key->value pair data structure, are you sure you want an array and not a dict?