Code Comments
Programming Forum and web based access to our favorite programming groups.Hello How to set the environment variable through tcl. setenv <name> <value> if i execute the same it not working.Is there any specific way in tcl where in we can set the variable. Thanks chendu
Post Follow-up to this messageChendu schrieb: > Hello > How to set the environment variable through tcl. > > setenv <name> <value> > > if i execute the same it not working.Is there any specific way in tcl > where in we can set the variable. > set ::env(name) value e.g. set ::env(PATH) /usr/local/bin Michael
Post Follow-up to this messageMichael Schlenker wrote:
> Chendu schrieb:
>
> set ::env(name) value
For those that like setenv...
proc setenv {name value} {
set ::env($name) $value
}
Donal.
Post Follow-up to this messageIn article <fae9o7$594$1@godfrey.mcc.ac.uk>,
Donal K. Fellows <donal.k.fellows@manchester.ac.uk> wrote:
>Michael Schlenker wrote:
>
>For those that like setenv...
>
> proc setenv {name value} {
> set ::env($name) $value
> }
>
>Donal.
Understand, this does NOT set the environment of the process which
*invokes* a Tcl application; the latter is often what questioners
think they want <URL: http://wiki.tcl.tk/4282 >.
Post Follow-up to this messageCameron Laird wrote: > Understand, this does NOT set the environment of the process which > *invokes* a Tcl application; the latter is often what questioners > think they want <URL: http://wiki.tcl.tk/4282 >. Mind you, nothing does except editing a file/registry entry[*] and restarting the shell or reloading its configuration. This is by deliberate design, and applies to thing other than Tcl. Donal. [* Depending on platform. ]
Post Follow-up to this messageIn article <faemmk$8r8$1@godfrey.mcc.ac.uk>, Donal K. Fellows <donal.k.fellows@manchester.ac.uk> wrote: >Cameron Laird wrote: > >Mind you, nothing does except editing a file/registry entry[*] and >restarting the shell or reloading its configuration. This is by >deliberate design, and applies to thing other than Tcl.
Post Follow-up to this message"Donal K. Fellows" <donal.k.fellows@manchester.ac.uk> wrote: > Cameron Laird wrote: > > Mind you, nothing does except editing a file/registry entry[*] and > restarting the shell or reloading its configuration. This is by > deliberate design, and applies to thing other than Tcl. > > Donal. > [* Depending on platform. ] Sufficient knowledge of the internal data structures of the platform lets you do theoretically impossible things. In my early career as a software developer, I wrote a large collection of DOS programs that communicated with each other by manipulating the "root" environment. (There was much about that project I should have done differently, or not done at all. Basing the entire architecture of the user interface and network communication around the capabilities of a Hercules Network Card Plus made for a fast and reasonably pretty system, but when the supply of monochrome monitors started to dry up...)
Post Follow-up to this messageAlan Anderson wrote: > Sufficient knowledge of the internal data structures of the platform > lets you do theoretically impossible things. In my early career as a > software developer, I wrote a large collection of DOS programs that > communicated with each other by manipulating the "root" environment. You can't do that on "modern" systems, i.e. anything with virtual memory or real memory protection! You either can't see the root environment at all, or can't recognize it, or can't write it (the most common case.) Donal.
Post Follow-up to this messageDonal K. Fellows wrote: > Alan Anderson wrote: > > You can't do that on "modern" systems, i.e. anything with virtual memory > or real memory protection! You either can't see the root environment at > all, or can't recognize it, or can't write it (the most common case.) You can, if you have enough privileges -- or at least the right ones. After all that is how ACPs work. -- +--------------------------------+---------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+
Post Follow-up to this messageOn Aug 22, 6:43 am, "Gerald W. Lester" <Gerald.Les...@cox.net> wrote: > Donal K. Fellows wrote: > > > You can, if you have enough privileges -- or at least the right ones. > > After all that is how ACPs work. > > -- > +--------------------------------+---------------------------------------+ > | Gerald W. Lester | > |"The man who fights for his ideals is the man who is alive." - Cervantes| > +------------------------------------------------------------------------+ i am able to set env variable and able to get it with in the same tcl script . But if i want to access in the value in other tcl script with out editing the shell rc file. Is there any way Process: 1.I would open a shell. 2.run a tcl script to set a env variable 3.run a second tcl script to accss the env variable set by 1st script. i tried using as in wiki source export myvar=<value> but i am not able to get it. basically i am not able to get what export does. Thanks chendu
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.