How to print all environment variables in TCL?
11,399
There is an array called env that stores all the environment variables. So you can simply do this:
puts [array get env]
or simply
parray env
Author by
becks
Updated on July 30, 2022Comments
-
becks over 1 year
In TCL, how can I print all environment variables using a single line command?
-
Donal Fellows over 11 yearsThe difference between the two is that
parray
sorts the keys, does nice indentation, and otherwise generally makes the output easy to read.array get
doesn't; it's intended mainly for serialization of an array's data (ready to use witharray set
). -
Matt Warren about 6 yearsputs [array get env] - for me this prints nothing at all ?