FAQ Database Discussion Community


Run simple programme using unix shell

shell,unix,environment-variables
I'm new to unix and its developing. In my new.sh script I wrote $USERNAME=user $PASSWORD=sekrit echo $USERNAME and ran new.sh using bash new.sh But I get the following errors new.sh: line 1: =user: command not found new.sh: line 2: =sekrit: command not found How do I run that command and...

Docker Node JS set env

node.js,docker,environment-variables
How to set node ENV process.env.mysql-host with docker run? Can i somehow do like this? docker run --mysql-host:127.0.0.1 -p 80:80 -d myApp I am using FROM node:onbuild as image....

How to run application from command prompt with arguments?

windows,command-line,windows-7,environment-variables
I have an application named DriveMaster which I want to run from command line with different arguments. The application is residing in: "C:\Program Files (x86)\ULINK DM2012 PRO NET\v970\DriveMaster.exe\" Now in Windows - Run, if I open command prompt and want to give a command like: DriveMaster /s:Scriptname.srt This should be...

Windows User Environment Variable vs System Environment Variable

windows,powershell,cmd,environment-variables
In Windows, is there any shell/Powershell command to list User Environment Variable and System Environment Variable separately. If I do - SET TEMP Windows displays the User Environment Variable instead of System variable for Temp. I am looking for shell command/switch to display these variables separately....

No environment variable set after installation of MSI generated by WIX

wix,environment-variables
My WSX file looks like this: https://gist.github.com/pyeremenko/891eceb779197e4be240#file-sample-wxs-L23-L25 Copying works fine, i.e. exe file available in Program Files/test/my_test folder, but I can't access TEST env variable after installation via echo %test% (of course I reload cmd) I tried also to look for it in System Properties > Environment Variables, but there...

Pipe in for loop breaks double quoted variables

batch-file,for-loop,pipe,environment-variables,double-quotes
Situation: Using batchscript to retrieve certain values from a JSON. I've got the following batchscript: @ECHO off ECHO Enter npo.nl program-url : SET url= SET /P url= :: http://www.npo.nl/buitenhof/03-05-2015/VPWON_1232766/POMS_VPRO_850040 for example SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=6 delims=/" %%A IN ("%url%") DO ( FOR /F "delims=" %%B IN ('curl.exe -s http://e.omroep.nl/metadata/aflevering/%%A...

Use Dokku Environment variables in DockerFile

docker,environment-variables,dockerfile,dokku
I'm tring to use Dokku Environment variables in DockerFile but with no success. Dokku Env is set with: dokku config:set www NR_APP=AppName In DockerFile, i would like to put this NR_APP to a file with: RUN sh -c 'echo "newrelic.appname=\"$NR_APP\"" >> /etc/php5/apache2/conf.d/newrelic.ini' But it doesn't work, the result in file...

python itertools combinations logic

python,environment-variables,itertools,scopes
I'm looking at the code for the combinations on the python documentation for itertools (https://docs.python.org/2/library/itertools.html) def combinations(iterable, r): # combinations('ABCD', 2) --> AB AC AD BC BD CD # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) if r > n: return indices = range(r)...

Using environment variables in gradle.properties file

java,gradle,environment-variables
I'm trying to set "org.gradle.java.home" property in gradle.properties file to run my gradle project on Java 8 while the rest of my system uses Java 7. Hance, JAVA_HOME is pointing to jdk 7 and not 8.... The problem is that i can't hardcode it to the properties file because other...

Why is my JAVA_HOME variable that I setup not working?

android,environment-variables,java-home,system-variable
I'm trying to install and use Android Studio. However, when I run the program after installing, it gives me this error: I went into my control panel and added an Environment Variable under System variables that looks like this: I restarted my computer after making this, but it still doesn't...

ENV variable isn't added correctly to the container environment

node.js,npm,environment-variables,docker,dockerfile
Here is my Dockefile FROM ubuntu:latest MAINTAINER mazzy WORKDIR /tmp RUN apt-get update && apt-get install -y wget RUN wget http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz RUN tar xvf node-v0.12.0-linux-x64.tar.gz RUN cp -r node-v0.12.0-linux-x64 /usr/local/ WORKDIR /usr/local RUN ln -s /usr/local/node-v0.12.0-linux-x64.tar.gz /usr/local/node # FIX HERE ENV PATH /usr/local/node/bin:$PATH RUN npm install -g bower EXPOSE 8080:8080...

Passing an environment variable (parameter) to dependency project in TeamCity

continuous-integration,environment-variables,teamcity
I have a build chain with two projects: A is the root project, B depends on it. B has two dependencies configured: an artifact and a snapshot dependency. One build configuration for B has an environment variable (parameter) set. However, I also need this parameter set for the root project...

batch variable from user input treated differently

batch-file,menu,environment-variables
I'm trying to create a menu selection with a Windows batch file. When I use a for loop which creates variable i, and use it to call variable something[i] with !something[%%i]!, it works perfectly. However, when I try to create variable j from user input, and use it to call...

Setting environment variable to a large value -> “Argument list too long”

linux,bash,shell,environment-variables
Inside a bash script, I set an environment variable to contain a string of 1 million characters. I do so like this: export LG=XXXXXXX # ... 1 million X's Immediately after this, I am able to echo it back without a problem, i.e. echo $LG However, any other unrelated commands...

Setting an environment variable on same line as program execution is different than setting it separately? - shell variables vs. environment variables

bash,shell,environment-variables,command-line-arguments
What is the difference between: prompt$ TSAN_OPTIONS="suppressions=/somewhere/file" ./myprogram and prompt$ TSAN_OPTIONS="suppressions=/somewhere/file" prompt$ ./myprogram The thread-sanitizer library gives the first case as how to get their library (used within myprogram) to read the file given in options. I read it, and assumed it was supposed to be two separate lines, so...

How do I persistently define environment variables in Java on Windows?

java,environment-variables
Is there a way to change Windows environment variables using Java? I tried with the cmd function set: Process exec = Runtime.getRuntime().exec(new String[] { "cmd", "/c", "set", "HTTP_PROXY=" + PROXY_URL }); if (exec.waitFor() != 0) { throw new IllegalStateException("Output: " + getText(exec.getInputStream()) + "Error: " + getText(exec.getErrorStream() + "\n" +...

Jenkins Get the job link in groovy script

jenkins,configuration,environment-variables,bulk
We need to update few Job configurations for all the jobs, There are several instances of jenkins running for multiple projects. We need to udpate SCM database path and the SCM password. I am able to do the database path, but for password there is no set method. So to...

How to access mongodb variables from nodejs cartridge on OpenShift?

node.js,mongodb,environment-variables,openshift,openshift-cartridge
I am trying to deploy an application prototype to openshift. It works locally with mongodb at 127.0.0.1. I am trying to get it to respect process.env.OPENSHIFT_MONGODB_DB_URL when in the openshift environment but that variable is not accessible to my nodejs cartridge at runtime. I can see that it is being...

os.environ not setting environment variables [duplicate]

python,windows,shell,command-line,environment-variables
This question already has an answer here: How do I make environment variable changes stick in Python? 9 answers I'm trying to set a Windows environment variable using Python. It seems that, contrary to the docs, os.environ can get environment variables but cannot set them. Try running these in...

Ionic - 'platform add android' Comand failed with exit code ENOENT

java,android,cordova,environment-variables,ionic
Please help me get my Windows 8/Ionic/Cordova/Android environment setup correctly. I'm trying to use the command 'add platform android' but am unable to get it to work. I have seen similar posts to this but none quite the same. I've tried un-installing Cordova and Ionic and reinstalling them as recommended...

How to get JBoss 7.1.3 to use my $JAVA_HOME environment varaible?

jboss,environment-variables,jboss7.x,java-home
I'm using Mac 10.9.5 with JBoss 7.1.3.Final. I am launching JBoss through the termianl (bash shell), like so Daves-MacBook-Pro:core davea$ cd $JBOSS_HOME/bin Daves-MacBook-Pro:bin davea$ sudo sh standalone.sh Within the shell, I can see that $JAVA_HOME is defined ... Daves-MacBook-Pro:bin davea$ echo $JAVA_HOME /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home However, JBoss is not picking up this...

How to store environment variables in a Python Flask app?

python,flask,environment-variables
I have a Python Flask app that accesses the Github API. For this I need to store an access token. What is the common practice to store that data and how do I access that inside my app? from flask import Flask, request app = Flask(__name__) app.config['DEBUG'] = True @app.route('/',methods=['POST'])...

System environment variables in Jetty application

java,jetty,environment-variables,jetty-9
How to configure system environment variables inside one Jetty application? e.g. For database connection details, putting it in file and checking it into cvs is bad idea. For that reason using system environment is one way to go. While the system environment variables are defined in /etc/environments file or .bashrc/.zshrc...

Changing JS variable with Grunt for different environments

javascript,build,gruntjs,environment-variables
I'm trying to configure my JS build to do next: I'm using a JS variable to define the application root: globals.js define(function (require) { "use strict"; return { mainRoot: "http://myapp.com" //mainRoot: "http://localhost:3000" - local run //mainRoot: "http://myapp-test.com" - test server }; }); During local development I'm using code without Grunt...

Is there any better way to pass sensitive data to the program, alternative to env variables?

node.js,testing,twitter,environment-variables
I want to use npm twitter package, and it recommends to use env variables, but setting it up on windows machines is horror, so I want to avoid env variables. Next try is keep variables in external json file (like here in my repo), which is never be committed, but...

Error passing parameters in play framework

playframework,playframework-2.0,environment-variables
I have a play framework with one of the config file pointing to redis configuration. redis.host="$IP_ADDR" where IP_ADDR=XXX.XXX.XX.XX(in environmental variables) The error message is Caused by: java.net.UnknownHostException: $IP_ADDR Q1)Why is it pointing to $IP_ADDR when it should point XXX.XXX.XX.XX? When I run in shell with sh run.sh -Dredis.host="$IP_ADDR" it is...

Batch Variable name and Percent sign

variables,batch-file,environment-variables,variable-scope
I have a variable named ABC SET ABC=Brazil I have another variable named DEF containing a string with the name of the first variable: SET "DEF=%%ABC%%" How can I access to the string "Brazil" by only using the variable DEF? (I can't use the variable ABC) If I use the...

Can SQL*Plus read environment variables from the machine is it running on?

oracle,environment-variables,sqlplus
I'm aware that the database engine itself is (often) on another machine and that SQL*Plus has no direct way of reading those environment variables, but I'm in a tricky situation where I merely need the environment variables from the machine the client itself is running on. Is there a way...

Referring to an ENV variable through javascript

javascript,ruby-on-rails,google-analytics,environment-variables
I'm trying to set up Google Analytics, and refer to different tracking ids based on environment. I have a sandbox version of google analytics that has one id, running in a staging environment, and a production version of Google Analytics that has another id, running in a production environment. I'm...

Python: can't access newly defined environment variables

python,bash,environment-variables
I can't access my env var: import subprocess, os print os.environ.get('PATH') # Works well print os.environ.get('BONSAI') # doesn't work But the env var is well added in my /home/me/.bashrc: BONSAI=/home/me/Utils/bonsai_v3.2 export BONSAI And I can access this env var from a new terminal....

Export of PATH not permanent

linux,path,export,global-variables,environment-variables
I'm using this command to export the path to use some packages I installed globally. export PATH=~/.composer/vendor/bin:$PATH the problem is whenever I restart my machine, I would still need to export it again. Is there a way to make this export permanent?...

How to set environment variables on compute nodes in an MPI job

environment-variables,mpi
I don't understand how the environment is set on compute nodes when running with MPI under a scheduler. I do: mpirun -np 1 --hostfile ./hostfile foo.sh with foo.sh: #!/usr/bin/env zsh echo $LD_LIBRARY_PATH Then I do not recover the LD_LIBRARY_PATH I have got in an interactive shell... What are the initialization...

how to pass tmux varible to external script for the status bar

shell,environment-variables,zsh,statusbar,tmux
I am using the default <#{pane_current_path}> to display the current working directory for the current pane used. However the result is a lengthy full directory path taking lot of space in the status bar. What I wanted is to use a shell script or ruby script to cut it short...

In Python, how should one test for the existence of a file in a path specified in an environment variable?

python,bash,path,environment-variables,system
I want to check for the existence of the following file: $ANALYSISDIRECTORY/data/AnalysisDerivative/configuration.txt Currently, I have a little function to ensure that a file exists: def ensureFileExistence(fileName): log.debug("ensure existence of file {fileName}".format( fileName = fileName )) if not os.path.isfile(fileName): log.info("file {fileName} does not exist\n".format( fileName = fileName )) sys.exit() How should...

Docker command with env var prepended (local env var)

python,shell,docker,environment-variables,docker-compose
I am using Docker Compose to spin up some containers, but I don't get the command working. I would like to start my Flask server, but also set an env var for it. Here's what I've done: web: command: INSTASONG_ENV=production python manage.py runserver Unfortunately, I get this error: Cannot start...

what is the environment variable for 'app alias' on OpenShift?

environment-variables,openshift,openshift-client-tools
I have checked all the variables listed on the official link, For a deployed app on openshift, How do i get the alias of the app? I've added subdomain.example.com as the alias, but the variable OPENSHIFT_APP_DNS is just showing the *.rhcloud.com address but not the alias added, how do I...

GLM in all data frames global environment

r,loops,global-variables,environment-variables,glm
I have a master data frame that contains ~200 unique 'IDs' and each of these IDs have about ~200 each 'orders'. I have split the master data frame into 200 individual data frames using list2env(split(df, df$id), envir = .GlobalEnv) Now since I have 200 individual data frames per each unique...

How can I pass all current environmental variables in a node spawn?

node.js,environment-variables,parent-child,spawn
I am spawning child tasks in Node the following way: function createChildProc(prog, params0, cmdAndEnv) { var spawn = require('child_process').spawn; return spawn(prog, params0, cmdAndEnv); } Where cmdAndEnv manually contain the environment variables created during the initial fire up of Node. Instead of manually issuing all the environmental variables into the spawned...

Environment variable $QUERY_STRING is not being included with *envp[]

c,linux,raspberry-pi,environment-variables,getenv
I have set an environment variable with the following command: QUERY_STRING='This is my query string' This is my program: #include <stdio.h> #include <stdlib.h> void main (int argc, char *argv[]) { printf("%s\n", getenv("QUERY_STRING")); } And this is what I get when I run the program: [email protected] /testing/cgi_download/temp $ echo $QUERY_STRING; ./a.out...

Set environmental variable in VS12 C#

c#,dll,environment-variables
I want to apply the following fix: click me but I don't find how or where to set this. all I found is something with the command, but when I enter this in cmd it doesn't work.. Isn't there a simple file where I could edit this variable? Or a...

PATH is not updated when I login

linux,bash,debian,environment-variables,.profile
I am one of the users of a lab computer. I want PATH to be: PATH=/home/gsamaras/mpich-install/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games instead of this: PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games For that reason, I modified .profile: # set PATH so it includes user's private bin if it exists #if [ -d "$HOME/bin" ] ; then # PATH="$HOME/bin:$PATH" if [ -d...

How to easily configure multiple u-boot variables

environment-variables,u-boot
I need to change multiple u-boot environment variables every time I setup a new embedded device e.g. ip address, ethernet address, etc. Typing at the terminal prompt is tedious, and, I don't know if it's my terminal, buy trying to cut and paste anything more than a few characters can...

Java processbuilder and using environment variables

java,linux,process,environment-variables,processbuilder
What I want to do is I want to run a process, however because this process itself relies on environment variables, directly calling it causes error within the process. For those who are wondering what this is, it's rake tool. For this reason I thought maybe it's better to use...

Using SSIS Environment variable on different servers

sql-server,deployment,ssis,environment-variables
I have read several articles about Environment variables but I can't find how to apply their usage in my case. I am developing SSIS packages on my local machine. Once they are finished I plan to deploy them on staging an production server. My SSIS project consists of several packages...

Loading dll using loadLibrary

java,jni,64bit,environment-variables
I am currently maintaining a Java communication library which wraps the functionality offered by some dll via JNI. At some point, in Java, I need to load the JNI wrapper to forward my requests and finally call the native library. Currently, this is accomplished by calling System.loadLibrary("MyLibrary"); As stated here,...

How does installers set PATH variable on Mac OSX?

osx,go,terminal,environment-variables
I'm wondering how PATH variable is set by Mac Installers on Mac OSX. For example: Look at golang Mac OSX Installer. From the link https://golang.org/doc/install: Mac OS X package installer Download the package file, open it, and follow the prompts to install the Go tools. The package installs the Go...

Setup cx_Oracle Environmental Variables with Python

python,python-3.x,environment-variables,cx-oracle
cx_Oracle for Python requires certain Environmental Variables to be set in place to import and work correctly. Rather than trying to wrap my application in a bash script, which I've done in the past, I'm trying to setup the variables using only Python. Below is what I have in place...

How can I check if an environmental variable is set in node js?

javascript,node.js,environment-variables
I would to check if an environmental variable is set in my nodejs express server. In base of it is set or not, I would do different operations. I've tried this: if(process.env.MYKEY !== 'undefined'){ console.log('It is set!'); } else { console.log('No set!'); } I'm testing without the process.env.MYKEY... but the...

Label Git repository in AppVeyor build using environment variable

git,environment-variables,yaml,appveyor
I am trying to label a repository after a successful build in AppVeyor. I have read the following resources: Environment variables appveyor.yml reference Pushing to remote Git repository from a build But I don't know how to substitute in an AppVeyor environment variable. Here is the Yaml that I am...

Apache Spark on EC2. Environment Variable problems. Mac OSX

osx,amazon-ec2,environment-variables,apache-spark
I am following the tutorial found here to get a Spark Cluster up and running. I am using a Mac OS 10.9. I am new to using a Mac. When attempting to launch the cluster I get an error: ERROR: The environment variable AWS_ACCESS_KEY_ID must be set I don't fully...

Multiple environments for Ruby application

ruby-on-rails,ruby,configuration,environment-variables
I've been writing Rails apps for so long that I'm suddenly stuck with something you get for free with Rails: environments. That is to say, you can run the Rails app locally and by default, RAILS_ENV (or Rails.env) is "development". And if you are running your specs/tests, it's "test" and...

How to set environment variables with a forward slash in the key

bash,shell,environment-variables
Is there a way to export an environment variable with a slash in the name such as: export /myapp/db/username=someval This post indicates it should be possible but I cannot figure out valid syntax to do so. For background: I am using confd to produce config files from a template and...

how to set environment variables in Yosemite

osx,environment-variables,osx-yosemite
This question has been asked before but the solutions assume that you are acquainted with OS X, unfortunately I'm not, so please bear with me. I would like to use qmake from the terminal command. With Yosemite, I'm not able to find an easy way to do it. The solution...

When are environment variables loaded by java virtual machine for a program

java,environment-variables
I have a java program that I am writing that needs to use environment variables to find a policy file on start up of certain classes. However, the environment variable value will be conditional based on what the purpose is of the class that is being entered by the program....

java System.getenv environment names starting with “=”

java,environment-variables
I've noticed that the environment in Java on Windows (as obtained by a System.getenv() call) includes some variables that don't exist in the real environment. These begin with and equals-sign and include "=ExitCode" which maps to the exit code of the process that ran just before this java invokation; and...

How to set environment variables for Laravel 5 on AWS EC2 with MySQL

mysql,git,amazon-web-services,environment-variables,laravel-5
I have successfully deployed my laravel 5 app to AWS EC2. I have also created a MySQL database with AWS RDS and associated it with my app instance. Now I want to set my env variables so it uses homesteads default values when on my local machine in development, and...

How to use Environment Variable to set file from Java code?

java,environment-variables
I set environment variable CONFIG. Is it possible to use it to open file? String path = "$CONFIG/app/users.json" File file = new File(path); PS I cannot add whole path to file to the property file. It is required to use $CONFIG variable....

Can read but not update a newly created environment variable

c#,.net,wpf,environment-variables
I created a new environment variable to track the status of a possible failure condition, the variable is a simple flag called FailFlag that can be set or reset, with values FlagIsSet and FlagIsReset respectively. To create the environment variable I opened up system environment variables from Control Panel, and...

Using .sh script to set an environment variable

bash,shell,ubuntu,environment-variables
How do I write an .sh script what will globally set an environment variable on Ubuntu 14. i.e. #!/bin/sh sets this in to master /etc/environment export DB_HOST="123" I am aware I could just run this script and it would set it for the session only!, but what I actually want...

Rails environment variables failing to load in model

ruby-on-rails,model,environment-variables,rake
I have an environment variable that I'm using in two places, one is in a rake task, the other is in a model method. When I call it from the rake task, everything is fine and the variable loads, but when I call it from the model it doesn't find...

How to set global environment variables using shell script .sh

python,shell,ubuntu,environment-variables
I have a .sh file that locally sets some environment variables in my shell source my_env.sh. #!/bin/sh echo "Setting up local environment variables" export MY_URL="http://domain.com" echo "Done" This only sets the variables for that session. Which means that my Python Celery and Supervisor apps which run under a different session...

Strange error in batch file when handling a file path with Program Files (x86)

windows,batch-file,escaping,environment-variables
I am writing a batch script to remove quotes from the JAVA_HOME env variable and am getting an error only when JAVA_HOME is set with "Program Files (x86)" in the path. My JAVA_HOME variable is set to C:\Program Files (x86)\Java\jdk1.7.0_79(no quotes are in the value) set lastChar=%JAVA_HOME:~-1% set firstChar=%JAVA_HOME:~0,1% echo...

environment variables substitution with sed

replace,sed,environment-variables
I would like to replace following input (in a HTML page) : <base href="" /> by <base href="http://mywebsite.com/image/" /> for different files. Here's what I'm doing. For each file, we get the line of the file where <base tag is located. nb_ligne=$(grep -n '<base' $i | awk -F : '{print...

Passing variable from container start to file

sed,docker,environment-variables
I have the following lines in a Dockerfile where I want to set a value in a config file to a default value before the application starts up at the end and provide optionally setting it using the -e option when starting the container. I am trying to do this...

Python: Binomial distribution doesn't work when set as a variable

python,variables,environment-variables,scoping,binomial-theorem
I'm trying to recreate a single player version of a dice game called Dudo. The most relevant information is that six players have six hidden dice, and the point of the game is to guess how many of a certain kind of die are on the table in total (e.g....

Bash Variable Scope Leak

bash,shell,environment-variables
Usually, I see questions about people not being able to access variables from outside their scope. However, I seem to be experiencing the opposite: I am seeing variables still having values from inner scopes they should have given up afterwards. For example (making svn aliases similar to git aliases): function...

Where is the LANGUAGE environment variable set?

linux,environment-variables,locale,configuration-files,archlinux
I'm using zsh on my archlinux. My LANGUAGE environment variable was set to fr but I wanted to set it back to en_US.UTF-8 so I did it in my ~/.zshrc file. But was it the best place to set it? Isn't it dirty? This works but only for my user's...

bash export not setting variable

bash,environment-variables
I have a simple environment setup script that exports some environment variables like so. #!/bin/sh export NEWROOT=~/some/directory echo $NEWROOT This echos the correct directory, but after its run, when I echo $NEWROOT in the same shell, it returns nothing. Any idea why the variable isn't setting?...

Set ENV PATH of php and ffmpeg to use it inside PHP scripts with CLI like shell_exec()

php,apache,path,ffmpeg,environment-variables
I would like to execute commands in a php script like this: <?php shell_exec(php myfile.php) or <?php shell_exec(ffmpeg -i ...) My problem, i think is that php and ffmpeg path are not properly configured in my apache environment because when i execute this: <?php var_dump(shell_exec("which php")); var_dump(shell_exec("which ffmpeg")); I get...

Puppet: Set env variables & boot app - variables undefined

linux,environment-variables,vagrant,puppet
I am using Puppet to provision my Vagrant box. Among a few other tasks, the main.pp file is creating the /etc/environments file, then daemonizing the node.js app I'm running. The node app requires a few environment variables, but they're returning undefined. The relevant main.pp snippets: class environment { file {...

How to set Environment variables permanently in C#

c#,environment-variables
I am using the following code to get and set environment variables. public static string Get( string name, bool ExpandVariables=true ) { if ( ExpandVariables ) { return System.Environment.GetEnvironmentVariable( name ); } else { return (string)Microsoft.Win32.Registry.LocalMachine.OpenSubKey( @"SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" ).GetValue( name, "", Microsoft.Win32.RegistryValueOptions.DoNotExpandEnvironmentNames ); } } public static void Set( string...

lapply() emptied list step by step while processing

r,null,scope,environment-variables,lapply
First of all, excuse me for the bad title. I'm still so confused about this behavior, that I wasn't able to describe it; however I was able to reproduce it and broke it down to an (goofy) example. Please, could you be so kind and explain why other.list appears to...

I can't see environment variable on Express App

node.js,express,environment-variables
Variables are setted in .bashrc. I can see them on terminal $echo MY_VAR. Also I can see them on Node.js shell process.env.MY_VAR. But I can't see it in my Express App. file.js console.log("My var: "+process.env.MY_VAR); shows: 'My var' Thanks in advance...

ActiveMQ: Error while loading shared libraries

c++,eclipse,environment-variables,activemq
I have a C++ project that runs standalone, by launching its binary on console. However it does not run when I try on Eclipse, giving the following error: error while loading shared libraries: libactivemq-cpp.so.18: cannot open shared object file: No such file or directory I do know that the error...

Docker registry:2.0 overriding configuration options

amazon-s3,docker,environment-variables,docker-registry
Has anyone tried using environment variables to override configuration options in the registry, say if you have to use s3 bucket as the storage for example. I read the doc and it says (https://docs.docker.com/registry/configuration/): Overriding configuration options Environment variables may be used to override configuration parameters other than version. To...

What is the meaning of environment variable !::=::\

bash,cygwin,environment-variables
I have found out my environment variables a strange line: $ env ... !::=::\ ... When I start a shell or run bash script, it is sometimes present, sometimes not. And when it is absent my bash calls to subshells $(...) require 3 escape backslashes instead of each 1. Any...

Something's wrong with Leiningen

clojure,environment-variables,leiningen
I downloaded the windows installer for Leiningen and there didn't seem to be any issues, but when I start a Clojure REPL it doesn't recognise any Lein commands. I thought the issue might be with my Enviroment Variables, but they all seem to be in order: http://imgur.com/a/kSXrE Does anyone know...

Using Figaro and Secrets.yml to Manage Env Variables

ruby-on-rails,ruby-on-rails-4,environment-variables,figaro
I have a rails 4.1 app and I'm trying to organize my env variables. As of right now I have a secrets.yml file in my config/ folder. I also installed the figaro gem. My goal was to have all my env variables in the application.yml (not checked into git) file...

python virtualenv — possible to augment $PATH or add other environment variables?

python,environment-variables,virtualenv
I'd like to alter my $PATH only in a Python virtual environment. Is it possible to have the $PATH change when I activate a virtual environment?

Rake not exporting PATH

ruby,path,environment-variables,rake
I would like a Rake task to export the path to my command line tool to $PATH, and so I have the following line in my Rakefile: task :make_path do sh 'export PATH=$HOME/Desktop/folder:$PATH' end When putting that line export PATH=$HOME/Desktop/folder:$PATH into the terminal directly, the path is prepended to my...

Spark configuration, what is the difference of SPARK_DRIVER_MEMORY, SPARK_EXECUTOR_MEMORY, and SPARK_WORKER_MEMORY?

linux,memory,apache-spark,environment-variables,config
I did my work, read the documentation at https://spark.apache.org/docs/latest/configuration.html in spark-folder/conf/spark-env.sh: SPARK_DRIVER_MEMORY, Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb) SPARK_EXECUTOR_MEMORY, Memory per Worker (e.g. 1000M, 2G) (Default: 1G) SPARK_WORKER_MEMORY, to set how much total memory workers have to give executors (e.g. 1000m, 2g) what is the relationship of...

ubuntu, installation of a library, what to write in prefix and in environment variable

ubuntu,installation,environment-variables,ubuntu-14.04,prefix
I have recently started using ubuntu. I am installing linbox library: http://www.linalg.org/developer.html. The installation guide states that one should install several libraries, including fflas-ffpack library, and then run the script autogen.sh, optionally specifying the installation prefix: cd linbox ./autogen.sh [--prefix=] [options]. [options] include --with-fflas-ffpack=, which, according to the installation guide,...

python override environment variable in local scope

python,perl,environment-variables
How can I override the environment variable in a local scope? I know how to do it in perl, but not python. In perl: if (1) { local $ENV{PATH} = "/usr/bin:/bin:/usr/sbin:/sbin"; print "$ENV{PATH}\n"; } print "$ENV{PATH}\n"; the output would be: /usr/bin:/bin:/usr/sbin:/sbin /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin Any idea how to do the same in...

Skipping parts of a Travis job if building from a fork

environment-variables,travis-ci
I've been writing some shell tasks that can't run unless there are secure environment variables present in a Travis CI PR build. There is an auth token that must be present to push some information up about the build, so for builds originating from forks, I'd like to simply skip...

How to use environment variables in Jenkins git plugin configuration

jenkins,environment-variables,jenkins-plugins
I've got a job that checks out code from git. I'm using the Pre-scm build step plugin to run a simple batch script that creates a variable BRANCH_NAME. I am trying to configure the git plugin to check out to a sub-directory with the value of BRANCH_NAME. I know I...

R - get values from multiple variables in the environment

r,environment-variables,value
I have some variables in my current R environment: ls() [1] "clt.list" "commands.list" "dirs.list" "eq" "hurs.list" "mlist" "prec.list" "temp.list" "vars" [10] "vars.list" "wind.list" where each one of the variables "clt.list", "hurs.list", "prec.list", "temp.list" and "wind.list" is a (huge) list of strings. For example: clt.list[1:20] [1] "clt_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc" "clt_Amon_ACCESS1-3_historical_r1i1p1_185001-200512.nc" [3] "clt_Amon_bcc-csm1-1_historical_r1i1p1_185001-201212.nc"...

Seems unable to pull config vars from the environment (Heroku)

ruby-on-rails,ruby,ruby-on-rails-4,heroku,environment-variables
My Rails app seems unable to pull config variables from the environment. Forms work fine when credentials are hard-coded but when I try to use the environment variables it fails. What could be going wrong? I might have made a basic mistake since I'm only a newbie programmer. I've set...

What is the Ruby equivalent of PHP $_ENV?

php,ruby,cgi,environment-variables
I am writing a small CGI script in Ruby, which logs the data of visitors. I would like to log all CGI environment variables like REMOTE_ADDR, USER_AGENT, HTTP_REFERER etc. It was quite easy to iterate over the $_ENV array in PHP, and dump all the variables to examine them, but...

What is a better way for checking for the existence of an environment variable in the Maven antrun plugin?

maven,environment-variables,antrun,maven-antrun-plugin
I’m using Maven 3.2.3. I have this for my ant run plugin … <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <dependencies> <dependency> <groupId>ant-contrib</groupId> <artifactId>ant-contrib</artifactId> <version>20020829</version> </dependency> </dependencies> <executions> <execution> <id>create-dodeploy-file</id>...

R Programming - creates variable in in the environment it was called

r,variables,environment-variables,environment
I have a function who's task is to create a variable in the parent object. What I want is for the function to create the variable at the level at which it's called. createVariable <- function(var.name, var.value) { assign(var.name,var.value,envir=parent.frame()) } # Works testFunc <- function() { createVariable("testVar","test") print(testVar) } #...

How to automatically set Maven compiler plugin based on $JAVA_HOME env variable?

environment-variables,maven-3,java-home,maven-compiler-plugin
I’m using Maven 3.2.3. I have a multi-module project and currently have my Maven compiler plugin set as such <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> <compilerArgument>-proc:none</compilerArgument> <fork>true</fork> <!-- <debug>true</debug>...

Python doesn't recognize environment variable

python,environment-variables,xsl-fo
I am trying do convert XSL-FO to PDF following this tutorial, but to do that I need to run a command that uses an environment variable called FOP_CMD: doc = Document(tfactory('/home/username/Downloads/file.fo')) doc.generate(params, oformat='pdf') I saved the environment variable in the file ~/etc/environment and if I run echo $FOP_CMD in the...

log4j2.xml sys vs env on Desktop application and in Tomcat Webapp

tomcat,logging,tomcat7,environment-variables,log4j2
I have both a dekstop application and a tomcat web application that write to a log file using log4j2. I also then have the log4j2.xml configuration file. The file it is writing to is held within a folder that as stored as an environment variable. The log4j2.xml file thus looks...

Execute python program with bash script

python,bash,environment-variables
I have following bash script: export MYCONFIG_CONFIG=TEST /home/bmwant/projects/test/venv/bin/python3 /home/bmwant/projects/test/script.py My python script needs environment variable which I have set, but running this script as bash run_python.sh shows an error /home/bmwant/projects/test/venv/bin/python3: can't open file 'home/bmwant/projects/tes': [Errno 2] No such file or directory What is wrong? I have set script as executable...

Environment variables not working in Microsoft Visual Studio Code?

environment-variables,vscode
Testing out the new Microsoft Visual Code Studio. Trying to set some environment variables, and it seems setting them makes OpenDebug not run. Throws the error "OpenDebug process has terminated unexpectedly" And here's it running without issue when the environment variables is commented out. Am I using it wrong or...

VBScript - Read environment variable in if statement

if-statement,vbscript,environment-variables
What changes must I make for the if statement in my code extract below to work as expected? dim warn, txtfilelocate, txtcontent, file, txtfile, content call START sub START do while len(txtfilelocate) = 0 txtfilelocate = inputbox ("Please enter the full path of the text file containing your email content",...

Replace the name of environment variable by it's actual value from environment in a text file

powershell,active-directory,automation,environment-variables,silent-installer
I am trying to automate Active Directory installation on Windows Server 2008 using windows powershell. I created a text file with .tmpl extension and added: [DCINSTALL] ReplicaOrNewDomain=_ReplicaOrNewDomain__ Then I created an answer file in a text format: [DCINSTALL] ReplicaOrNewDomain=$env:ReplicaOrNewDomain Now I want to be able to write a script in...

Environment vars by Power Shell

windows,powershell,environment-variables,windows-8.1
How can I get environmet variables by Power Shell? What command should I execute. I use Windows 8.1

Difference between using “set” and not using set for variables? In Cygwin.

variables,cygwin,environment-variables
I don’t understand the difference between: set youtube=’https://youtube.com’ and youtube=’https://youtube.com’ With the second one, I’m able to use it in the middle of a command, such as: cygstart $youtube and that works. Why and how are these different? They both set variables? And, when I don't use the word "set"...

Log access to environment variables in windows

windows,environment-variables
I have a legacy application (for windows 98) which searches for configuration files using the some paths it finds in the environment variables. The workstation where it was installed was recently formatted and I forgot to save the environment variables and don't know their names. Is there a way to...