Environment variables are available in Tcl by means of the env array. So to get the value of the USER variable, if there is one, you would access $env(USER). To get the path, you would use $env(PATH). And so on.
What I mean is, if it's an environment variable. Try this, in a Tcl shell use array get to turn the entire envrionment array into a list: set envlist [array get env]. Now, envlist will have pairs of elements in the form "variable name" "value".
If "USER" is there, try puts $env(USER). I think you're trying to use Tcl syntax in a UNIX command (with exec) and that might be your problem.
Yep, U R right ... puts and parray are redundant ...
Anyway, I tried your quick check and sure enough that worked:
>set env(USER) "DOGGY"
>parray env
So I'm back to my original problem, why can't I get to my env variables when running my script? What am I not including in my script? Why am I able to see all my env variables when running interactively?
Just for background info. - I'm starting wish like this in my script:
I'm not sure but I think you may be still in the Korn shell when you think you're giving commands in the Tk shell. I don't know how it is on UNIX, but on Windows, if I invoke Wish from a command console, I will now have 2 consoles: 1 DOS and 1 Wish. I don't know the syntax but I think you need to pass a script to Wish when you call it up from the Kshell.
... I've always been passing a script to wish when I call it up from a ksh. I was just explaining my start-up environment in case that provided any hints to the problem ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.