I got the following error from the TCL interpreter when trying to get the value of env variable:
puts $env
can't read "env": variable is array
How can get the value of a TCL variable if it is an array?
I got the following error from the TCL interpreter when trying to get the value of env variable:
puts $env
can't read "env": variable is array
How can get the value of a TCL variable if it is an array?
parray was introduced in Tcl8.5 and is used to 'puts' arrays:
parray env
Note that you need to provide the array name and not the array variable.
Otherwise, you can use a loop:
foreach {key value} [array get env] {
puts "env($key) = $value"
}
array subcommands. For example: foreach key [array names env] {puts "env($key) = $env($key)"}changes file (the only way to do code archaeology that far back quickly) it predates 6.5, as the changes for 6.5 document a behaviour change for it (probably a switch to using upvar instead of global) implying that it must've been there before and had users. It's all before my time going that far back...