tcl/tk $env(HOME) not found inside proc
In a tcl/tk script I can have the command 'cd $env(HOME)' and it works. I verified that it works by 'puts [exec "ls"] and seeing that the output is from my home directory. However, if I put this line inside a proc the variable is not found.
As a work around I set a global variable to $env(HOME) outside the proc and pass $HOME to the proc. I'll be using a lot of environment variables in my scripts and this workaround is cumbersome. Is there a way to make environment variables such as $env(HOME) global? |
This worked
Using $::env(HOME) within a proc worked.
|
All times are GMT -5. The time now is 04:15 PM. |