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
Share:
11,399
becks
Author by

becks

Updated on July 30, 2022

Comments

  • becks
    becks over 1 year

    In TCL, how can I print all environment variables using a single line command?

  • Donal Fellows
    Donal Fellows over 11 years
    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
    Matt Warren about 6 years
    puts [array get env] - for me this prints nothing at all ?