I tried to set environment variable as aaa.bbb in powershell from windows platform however it looks like it does not like ..   This works.  $Env:aaa = "testvalue"   This fails.  $Env:aaa.bbb = "testvalue2"   Is it possible to have environment variable name to have .?
124157
I know I can access environment variables in PowerShell using $Env. For example, I can access FOO with $Env:FOO.  I can't figure out how to access the environment variable called FOO.BAR.  $Env:FOO.BAR doesn't work. How can I access this from within PowerShell?
32418
I run across many shell scripts with variables in all caps, and I've always thought that there is a severe misunderstanding with that.  My understanding is that, by convention (and perhaps by necessity long ago), environment variables are in all-caps.  But in modern scripting environments like Bash, I have always preferred the convention of lower-case names for temporary variables, and upper-case ones only for exported (i.e. environment) variables.  For example:  #!/usr/bin/env bash year=`date +%Y` echo "It is $year." export JAVA_HOME="$HOME/java"   That has always been my take on things.  Are there any authoritative sources which either agree or disagree with this approach, or is it purely a matter of style?
43111
In the Windows registry, how does CurrentControlSet differ from ControlSet001 and ControlSet002? Which should be set when installing for all users? We are trying to add an environment variable for all users. Is this correct? HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Envinronment
87353
There's suppose any application installed in c:\program files\program.exe  How do I run this program by simply going to Start --> Run --> program.exe  I tried setting environment variable but that didn't help  I know programs like notepad and cmd run from Start --> Run cause they are there in the system32 folder. But how do I run an app which is not there?   EDIT:  This is what I did on windows xp:  Right click My Computer --> Properties --> advanced --&gt;environment variables--&gt;user variables for administrator--&gt;new--&gt;"variable name"&amp;"variable value"`. In variable value I put the path and in variable name I put an alias for the program Is what I did correct?
43318
Update: The link below does not have a complete answer. Having to set the path or variable in two places (one for GUI and one for shell) is lame.  Not Duplicate of:     Coming from a Windows background where it's very easy to set and modify environment variables (just go to System Properties > Advanced > Environment Variables), it does not seem to be that straight forward on Mac OS 10.5. Most references say I should update /etc/profile or ~/.profile. Are those the equivalent of System Variables and User Variables? For example, where should I set my JAVA_HOME variable?    EDIT:  I want to be able to access the variable from the terminal as well as an app like Eclipse. Also, I hope I don't have to restart/logout to make this take effect.
66334
Using Cygwin, I installed Environment Modules by downloading source code, running configure, make, and make install. Every time I run a module command, I get:  init.c(718):WARN:165: Cannot set TCL variable '!::'   I've traced this down to the fact that Cygwin has the following environment variable set:  $ env | grep :: !::=::\   Does anyone know what this is, where it is set, why it might be necessary, or how to get rid of it?  I might add that it's exceedingly difficult to Google, or even get to display correctly in Markdown.    From the comments:  $ unset '!::'  -bash: unset: `!::': not a valid identifier
64067
I've written the following script to set some environment variables when needed.  #!/bin/sh export BASE=/home/develop/trees echo $BASE export PATH=$PATH:$BASE echo $PATH   Below the command and the results I can see on my terminal: the script runs, but the variables are not set at the end.  ~$: ./script.sh /home/develop/trees /bin:......:/home/develop/trees ~$: echo $BASE  ~$:    What's wrong? Thanks in advance. Mirko
47465
How to add something to PATH ? I have added like   PATH=$PATH:/home/example export PATH   and it works until I restart , after that when  I type env in PATH there is no /home/example.
63360
I'm running Ubuntu 11.04. I use the terminal to start a bash session, and I want to add an environment variable:  $r@hajt:~$ env THEVAR=/example   But it's not working. It shows all the variables with THEVAR being the last one, but another call to env does not show THEVAR anymore- env | grep THEVAR returns nothing.  Similarly, scripts with export (export THEVAR=/example) or other variable assignments (THEVAR=/example) don't add the environment variable.  I know I'm doing something wrong, I know it should be something simple, but I just can't find what.  UPDATE: The real meaning of my question was this one:   (Anyway I'll choose the most voted answer and leave the edited title -that wasn't what I was asking)  env runs a program in a modified environment, then dismisses all the changes.
40465
In shell scripts one specifies language interpreter on shebang(#!) line. As far as I know, it is recommended to use #!/usr/bin/env bash because env is always located in /usr/bin directory while location of bash may vary from system to system. However, are there any technical differences if bash is started directly with /bin/bash or through env utility? In addition, am I correct that if I do not specify any variables for env, the bash is started in unmodified environment?
49400
I'm trying to set up Apache Tomcat on my pc, and it wants me to set up an environment variable for CATALINA_HOME.  Does any know how to do this?
111345
I'm trying to set several environment variables with the results from command substitution. I want to run the commands in parallel with &amp; and wait. What I've got currently looks something like  export foo=`somecommand bar` &amp; export fizz=`somecommand baz` &amp; export rick=`somecommand morty` &amp; wait   But apparently when using &amp; variable assignments don't stick. So after the wait, all those variables are unassigned.  How can I assign these variables in parallel?  UPDATE: Here's what I ended up using based off the accepted answer  declare -a data declare -a output declare -a processes  var_names=(     foo     fizz     rick )  for name in "${var_names[@]}" do     processes+=("./get_me_a_value_for $name") done  index=0 for process in "${processes[@]}"; do     output+=("$(mktemp)")     ${process} &gt; ${output[$index]} &amp;     index=$((index+1)) done wait  index=0 for out in "${output[@]}"; do     val="$(&lt;"${out}")"     rm -f "${out}"      export ${var_names[index]}="$val"      index=$((index+1)) done  unset data unset output unset processes
57130
How I can use a variable name in file path ?  ssl_certificate /home/ec2-user/.certificados/$server_name.crt; ssl_certificate_key /home/ec2-user/.certificados/$server_name.key;
108856
The instructions in  work to set the PATH for all 'normal' users. However, if I do sudo -s and then printenv PATH the updated path is not shown. I've taken a look at for example , but this does not seem to make sense to me, perhaps as I'm from a Windows background. Is there any way to set the truly system-wide path, such that the entries are inherited by absolutely every process running on the system?
75909
From what I've read, any changes to the environment variables in a Python instance are only available within that instance, and disappear once the instance is closed.  Is there any way to make them stick by committing them to the system?  The reason I need to do this is because at the studio where I work, tools like Maya rely heavily on environment variables to configure paths across multiple platforms.  My test code is  import os os.environ['FAKE'] = 'C:\\'   Opening another instance of Python and requesting os.environ['FAKE'] yields a KeyError.  NOTE: Portability will be an issue, but the small API I'm writing will be able to check OS version and trigger different commands if necessary.  That said, I've gone the route of using the Windows registry technique and will simply write alternative methods that will call shell scripts on other platforms as they become requirements.
92026
I'm trying to write a script and as I want to automate it as much as possible.  Is it possible to set the workspace as a variable so that when it is run as a standalone script, or as a tool in ArcToolbox, that it will allow everything else to run?  Below, for example, I want the user to select a workspace and then for the script to pick up the shapefiles from this workspace and also create the new geodatabase there.   # Create file Geodatabase # Import ArcGIS modules import arcpy print arcpy.ProductInfo() # Check out the ArcGIS Spatial Analyst Extension arcpy.CheckOutExtension("spatial") # Need to be able to OverWrite Outputs arcpy.env.overwriteOutput = True # Set workspace arcpy.env.workspace = "C:/Prog_Data" # Set up variables out_folder_path = "C:/Prog_Data" out_name = "Prog.gdb" # Execute CreateFileGDB arcpy.CreateFileGDB_management(out_folder_path, out_name) # Set local variables before importing shapefiles to Geodatabase inFeatures =  ["Points.shp", "Extent.shp", "Rivers.shp", "Population.shp"] outLocation = "Prog.gdb" # Execute shapefile to Geodatabase arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)
4447
I have a string representing a path.  Because this application is used on Windows, OSX and Linux, we've defined environment variables to properly map volumes from the different file systems.  The result is:  "$C/test/testing"   What I want to do is evaluate the environment variables in the string so that they're replaced by their respective volume names.  Is there a specific command I'm missing, or do I have to take os.environ.keys() and manually replace the strings?