In an overly complex tcl file, I want to save all local and env variables in a file before sourcing anotehr tcl script and once the script finishes I want to restore all the local and env variables. Something like this:
save_all_local_vars
save_all_env_vars
do_something
unset_all_local_vars
unset_all_env_vars
restore_all_local_vars
restore_all_env_vars
so at the end of the script I am sure that the whole environment is exactly matching to what I have before running ‘do_something’