In TCL, how can I print all environment variables using a single line command?
1 Answer
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 2 Comments
Donal Fellows
The 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 with array set).Matt Warren
puts [array get env] - for me this prints nothing at all ?