Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read / Write and display environmental variable

Status
Not open for further replies.

jimoo

Programmer
Jun 2, 2003
1,111
US
Looking for a script that can read an environmental variable and then display it. Also, looking for a script to write to one.

Would like to be able to test interactively.

Jim
 
Javascript is not allowed to access or modify environment variables

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
except in certain circumstances in IE, I believe. (hta files)
 
Hi

Unless the question is not about client-side JavaScript. Jim, please clarify abit on your goals.

For example in node.js you can access them with [tt]process.env[/tt], so displaying is just [tt]for [teal]([/teal]var key in process[teal].[/teal]env[teal])[/teal] console[teal].[/teal]log[teal]([/teal]key[teal],[/teal] [green]'='[/green][teal],[/teal] process[teal].[/teal]env[teal][[/teal]key[teal]])[/teal][/tt].

Regarding the "write" part, there is a limitation node.js warns about ( but equally valid for other languages/environments too ) :
Node.js Documentation | process | process.env said:
You can write to this object, but changes won't be reflected outside of your process.

Feherke.
feherke.ga
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top