Menu
  • HOME
  • TAGS

bash export not setting variable

bash,environment-variables

The shell is run in a separate process, and environment variables in a child process do not affect the environment variables in the parent process. If you want to run the script in the same process, you can use the dot command, like this: . myscript ...

Windows User Environment Variable vs System Environment Variable

windows,powershell,cmd,environment-variables

In PowerShell, there's no cmdlet for it, but you can use the underlying .NET methods in the Environment class: Write-Host "Machine environment variables" [Environment]::GetEnvironmentVariables("Machine") Write-Host "User environment variables" [Environment]::GetEnvironmentVariables("User") # This should be the same as 'Get-ChildItem env:', although it isn't sorted. Write-Host "Process environment variables" [Environment]::GetEnvironmentVariables("Process") ...

How to run application from command prompt with arguments?

windows,command-line,windows-7,environment-variables

In Windows 7: In the menu Start click Computer In the context menu, select System Properties Select Advanced System Settings -> tab Advanced Select Environment Variables Menu System Variables to find the PATH variable and click it. In the editing window, change the PATH, adding value: ; C:\Program Files (x86)\ULINK...

Docker Node JS set env

node.js,docker,environment-variables

Node's process.env is an object containing the user environment. Docker's CLI allows you to set the environment variable for the container using the -e or --env options. You can run docker run --env mysql_host=127.0.0.1 -p 80:80 -d myApp To pass the mysql_host into the container....

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

node.js,testing,twitter,environment-variables

just let your user choose what's best for him. implement (or use library as there are such libraries for most languages) something that will let you pass and shadow properties in many different formats: api, file, envs, command line. then: in your local test you can simply use api as...

Apache Spark on EC2. Environment Variable problems. Mac OSX

osx,amazon-ec2,environment-variables,apache-spark

You can create your environment variables in bash like: export AWS_ACCESS_KEY_ID=accesskeyhere export AWS_SECRET_ACCESS_KEY=secretkeyhere ...

Changing JS variable with Grunt for different environments

javascript,build,gruntjs,environment-variables

I find a combination of grunt-replace and grunt-config works well. In your Gruntfile.js, configure grunt-config like this (see the README): config: { local: { options: { variables: { mainroot: 'http://localhost:3000' } } }, test: { options: { variables: { mainroot: 'http://myapp-test.com' } } }, prod: { options: { variables: {...

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

environment-variables,openshift,openshift-client-tools

There is not currently an environment variable that holds this information within your application. If you need to retrieve it programmatically you might check into the OpenShift Online API (https://access.redhat.com/documentation/en-US/OpenShift/2.0/html/REST_API_Guide/)

Loading dll using loadLibrary

java,jni,64bit,environment-variables

Apparently, the loadLibrary() Documentation has managed to fool me a bit. In case of an UnsatisfiedLinkError it states UnsatisfiedLinkError - if the library does not exist. Therefore, I obviously assumed that loadLibrary() at no point was capable of seeing my specified library. That is, however, not the case as this...

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

javascript,node.js,environment-variables

try this. i do this in my node.js project and it working fine. if(process.env.MYKEY) { console.log('It is set!'); } else { console.log('No set!'); } ...

Jenkins Get the job link in groovy script

jenkins,configuration,environment-variables,bulk

import hudson.model.* jenkins = Hudson.instance for (item in jenkins.items){ println jenkins.getRootUrl()+item.getUrl() } Tried this in script console. Lists all jobs absolute URLs. You just need to add the logic to get your jobs list...

Docker command with env var prepended (local env var)

python,shell,docker,environment-variables,docker-compose

Setting environment variable might be set differently, as illustrated in tests/fixtures/extends/common.yml web: image: busybox command: /bin/true environment: - FOO=1 - BAR=1 In your case: web: command: python manage.py runserver environment: - INSTASONG_ENV=production ...

Can read but not update a newly created environment variable

c#,.net,wpf,environment-variables

Environment.SetEnvironmentVariable Public method Static member SetEnvironmentVariable(String, String) //Creates, modifies, or deletes an environment variable stored in the current process. Public method Static member SetEnvironmentVariable(String, String, EnvironmentVariableTarget) //Creates, modifies, or deletes an environment variable stored in the current process or in the Windows operating system registry key reserved for the current...

ActiveMQ: Error while loading shared libraries

c++,eclipse,environment-variables,activemq

Fixed it by adding the following line as make variable in the makefile. LD_LIBRARY_PATH:=../libs ...

Error passing parameters in play framework

playframework,playframework-2.0,environment-variables

You need to wrap the environment variable in brackets for the config library to reference it. redis.host=${IP_ADDR} ...

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

java,environment-variables

Processes are launched in an enviroment made of name-value pairs. When a program writes to an env variable, it can optionally make that write visible to child processes, but when you check the value you are likely using another process (maybe run via cmd.exe) that has no access to the...

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

python,variables,environment-variables,scoping,binomial-theorem

If you defined chance as a variable, its value was fixed when you created it. It will not "update" if you later change the value of i or anything else. You cannot "call" chance as you've defined it; it's just a static value, not a function. If you do something...

os.environ not setting environment variables [duplicate]

python,windows,shell,command-line,environment-variables

os.environ[...] = ... sets the environment variable only for the duration of the python process (or its child processes). It is not easily (i.e. without employing OS-specific tools) possible and surely not advisable to set the variable for the shell from which you run Python. See aumo's comment for alternative...

Bash Variable Scope Leak

bash,shell,environment-variables

There are two different phenomena in play: When variables are exported, they are copied into the environments of child processes. Non-exported variables are not passed on. Variables aren't exported unless you explicitly use export to mark them for export. export LESS_OPTIONS=-R # export so `less` sees this variable less Don't...

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

java,android,cordova,environment-variables,ionic

Sorry don't have enough privilege to comment on your question. I had faced similar issue. run this command before adding android platform, C:\your\Directory>npm link cordova C:\your\Directory>npm link ionic then go for, C:\your\Directory>ionic platform add android hope this helps!...

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

node.js,environment-variables,parent-child,spawn

The third argument is used to specify additional options. One of these options is env which contains the environment key-value pairs in an object. return spawn(prog, params0, { env: cmdAndEnv }); See the documentation for more details....

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

windows,batch-file,escaping,environment-variables

The simplest way to deal with problematic characters within environment variables is to use delayed expansion. You can do string substitution to remove any quotes. I am assuming you want the modified value to persist after the batch script ends, so I use a FOR variable to transfer the modified...

Passing variable from container start to file

sed,docker,environment-variables

That shouldn't be possible in a Dockerfile: those instructions are static, for making an image. If you need runtime instruction when launching a container, you should code them in a script called by the CMD directive. In other words, the sed would take place in a script that the CMD...

System environment variables in Jetty application

java,jetty,environment-variables,jetty-9

Not supporting System.getenv() is not a Jetty thing, but a Java thing. There are ton of restrictions around System.getenv() and your environment, making it nearly useless in all but the most naive and basic test case. (eg: multiline values are not supported. multiline entries can break parsing. keys without values...

VBScript - Read environment variable in if statement

if-statement,vbscript,environment-variables

Your txtcontent in: if file.fileexists(txtcontent) then contains a quoted file spec. Such quoting is good/necessary when you use .Run or .Exec to shell out, because the shell's parser uses blanks/spaces as separators. The FileSystemObject's method 'know' if an argument is meant as a path/file spec and are not fooled by...

How does installers set PATH variable on Mac OSX?

osx,go,terminal,environment-variables

There are a couple methods of setting environment variables in Mac OS X (lots of discussion here). In the case the Go package, it is adding a file in /etc/paths.d named go that contains /usr/local/go/bin. Here's an answer to another question explaining that a utility called path_helper is being launched...

How to easily configure multiple u-boot variables

environment-variables,u-boot

A script file is ideal for this situation. Its much better than copy & pasting for many commands and can handle much more complexity. You can enter all your commands into a text file and create a script image using mkimage (where myscript is the text file's name): mkimage -T...

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

ubuntu,installation,environment-variables,ubuntu-14.04,prefix

This depends on the package, which I have not looked at in any detail, but the general convention is: Without a prefix, the package will be installed in a system-wide default location, such as /usr/local/bin for a binary and /usr/local/lib for a library. If you want to change this (for...

Why is my JAVA_HOME variable that I setup not working?

android,environment-variables,java-home,system-variable

The issue is that you have a 32-bit installation of the JDK and Android Studio is asking for a 64-bit installation. You can tell it is 32-bit because the path you used for JAVA_HOME is located in 'Program Files (x86)' (where the '(x86)' indicates 32-bit programs). You need to install...

environment variables substitution with sed

replace,sed,environment-variables

Sticking with sed, here is a single substitution which does what you appear to be doing. sed -i "s%\(<base href=\)\"\"%\1\"http://mywebsite.com${i#$dir_root}\"%" "$i" I removed the /g flag as you are unlikely to ever have more than one <base> tag in a document, let alone multiple on the same line....

ENV variable isn't added correctly to the container environment

node.js,npm,environment-variables,docker,dockerfile

Your created symlink is invalid. Your /usr/local/node is pointing to a non existing file. You have to leave out the .tar.gz. Apart from that I recommend using the node:onbuild docker image as your basis. It was created as a building block for your own node application and already includes a...

java System.getenv environment names starting with “=”

java,environment-variables

System variables that start in equal sign are real. What you observe is not Java adding more environment variables; it is SET command hiding some of the variables. Windows prohibits the use of equal sign in names of environment variables that users can set, thus reserving variables with = in...

Python doesn't recognize environment variable

python,environment-variables,xsl-fo

Try setting the environment variable inside your Python program like so: import os if not 'FOP_CMD' in os.environ: os.environ['FOP_CMD'] = '/home/username/fop-1.1' ...

How to access mongodb variables from nodejs cartridge on OpenShift?

node.js,mongodb,environment-variables,openshift,openshift-cartridge

It sounds like a configuration error. I have a similar application and console.log(util.inspect(process.env)) gives me a clear picture of the mongodb environment variables. The developers page indicates that: Database environment variables pertain to a database, if one exists, and are used to connect an application to a database. Note that...

Something's wrong with Leiningen

clojure,environment-variables,leiningen

lein is a DOS/command line program, not a Clojure REPL extension. Just open a plain command line and type "lein" Note that lein is able to start a clojure repl with "lein repl"...

Environment variables not working in Microsoft Visual Studio Code?

environment-variables,vscode

Update: Visual Studio code 0.3.0 has fixed this. Environment variables do not work on Windows and Linux (they work on OS X). I have created a bug on our side and will make sure it’s fixed with the next release. Andre Weinand, Visual Studio Code...

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

java,environment-variables

The typical approach "if" you really need to set environment variables, is to code this logic in a wrapper script before launching the JVM (e.g. *.sh, *.cmd) You can then set the environment variables accordingly using export (linux) or set windows, etc....

how to set environment variables in Yosemite

osx,environment-variables,osx-yosemite

Terminal sessions use the shell. You only should modify shell environment variables, there is no need to reconfigure GUI programs. Also, I don't suppose the .plist offers a way to extend a preexisting variable. You could use ~/.profile: export PATH=$PATH:~XXXX/Qt/5.4/clang_64/bin If Qt offers a more canonical method of installation, that...

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

To make sure you access the value of the environment variable and not its string representation you can use os.path.expandvars If the path you want to test is in a environment variable you can user os.getenv...

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

continuous-integration,environment-variables,teamcity

Since TeamCity 9.0 it is possible to override the dependencies parameters by redefining them in the dependent build: reverse.dep.<btID>.<property name> ...

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

oracle,environment-variables,sqlplus

You can get a few client-related things from the USERENV context, but not arbitrary environment variables. If you can create a file on your local machine you could use the host command to set a substitution variable based on an environment variable: SQL > host echo define homedir=$HOME > /tmp/gethome.sql...

Where is the LANGUAGE environment variable set?

linux,environment-variables,locale,configuration-files,archlinux

I finally found out where LANGUAGE is set : It is set by KDE. I just used the KDE settings tools. But according to this link, I shouldn't use en_US.UTF-8 as a value, but something like "val1:val2:val3" : so if I want to set it with my .zshrc file, I...

Execute python program with bash script

python,bash,environment-variables

So, the problem was in file format. I have created it in Windows and then copy via FileZilla to remote server where I was trying to run it. So just run apt-get install dos2unix dos2unix run_python.sh bash run_python.sh and all will work well. Thanks @Horst for the hint....

Using SSIS Environment variable on different servers

sql-server,deployment,ssis,environment-variables

Creating your folder In the Integration Services Catalog, under SSISDB, right click and create a folder giving it a name but do not click OK. Instead, click Script, New Query Editor Window. This gives a query like DECLARE @folder_id bigint EXEC [SSISDB].[catalog].[create_folder] @folder_name = N'MyNewFolder' , @folder_id = @folder_id OUTPUT...

Label Git repository in AppVeyor build using environment variable

git,environment-variables,yaml,appveyor

Should be: - git tag -a release/%APPVEYOR_BUILD_VERSION% - git push origin release/%APPVEYOR_BUILD_VERSION% ...

Java processbuilder and using environment variables

java,linux,process,environment-variables,processbuilder

1) The varaibles you see in your java process are those inheritd from the process you started the java process from. I.e. If you launch it from a shell it should have the same variables as the shell had. You need to investigate which variables are actually set before launching...

Use Dokku Environment variables in DockerFile

docker,environment-variables,dockerfile,dokku

I've never used Dokku, but you will only be able to use those variables at run-time in a launched container. Docker intentionally doesn't allow you to pass in variables to docker build, so that builds are reproducible across environments. I suspect you can just write a script that configures the...

How to store environment variables in a Python Flask app?

python,flask,environment-variables

The simpliest way is to place it into configuration module (regular python .py file) and then import and use it in your code as suggested by this snippet on Flask site.

Run simple programme using unix shell

shell,unix,environment-variables

USERNAME is the name of the variable. $USERNAME is the replacement (aka contents, aka value). Since USERNAME is empty, you effectively try to run a command named =user, which is what the error message tells you. Remove the $ from $USERNAME=... and it will work....

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

python,environment-variables,virtualenv

You can write an activation script that sources virtualenv's activate (on linux, or calls the bat file on windows) and then updates PATH, PYTHONPATH and other environment variables. Use the virtualenv bootstrap hooks to install the script when the virtualenv is created and call it instead of activate.

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

bash,shell,environment-variables

export only marks valid shell identifiers to be exported into the environment, not any string that could form a valid name/value pair in the environment. You can use env to create a new shell instance with such an environment, though. env "/myapp/db/username=someval" bash ...

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

r,variables,environment-variables,environment

Try this: createVariable <- function(var.name, var.value) { assign(var.name,var.value,envir=parent.env(environment())) } Edit: Some more details here and here. With the initial solution, the variable is created in the global env because parent.env is the environment in which the function is defined and the createVariable function is defined in the global environment. You...

Using .sh script to set an environment variable

bash,shell,ubuntu,environment-variables

Run your script from /etc/profile, then you'll get what yuo're after.

GLM in all data frames global environment

r,loops,global-variables,environment-variables,glm

Try this example: #dummy data set.seed(123) df <- data.frame( id=rep(c(1,2,3),10), response_var=rep(c(1,2),15), variableA=runif(30), variableB=runif(30), variableC=runif(30)) #split by id df_list <- split(df,df$id) #loop through every id do.call(rbind, lapply(df_list, function(x){ fit <- glm(response_var ~ variableA + variableB + variableC, family=gaussian(), data=x) coef(fit) })) #output # (Intercept) variableA variableB variableC # 1 0.630746 1.4443321...

python itertools combinations logic

python,environment-variables,itertools,scopes

Python is not block scoped. Roughly speaking, Python is function scoped. In other languages, if you did for (int i = 0; i < whatever; i++) { ... } then i would be local to the for loop. In Python, the equivalent for i in xrange(whatever): uses an i variable...

How to use environment variables in Jenkins git plugin configuration

jenkins,environment-variables,jenkins-plugins

If the "Check out to a subdirectory" option does not support support variables, you could use a fixed name, like "x". Then your first build step could execute mv x $GIT_BRANCH Note, that $GIT_BRANCH contains name of the git remote and branch, like "origin/master", so possibly you would want mv...

Using environment variables in gradle.properties file

java,gradle,environment-variables

You can edit your gradlew.bat file, and make all developers use this (wrapper) gradle, and not local installation. Edit it, and anywhere it uses the JAVA_HOME use your env variable instead.

Setup cx_Oracle Environmental Variables with Python

python,python-3.x,environment-variables,cx-oracle

It is likely this question has been already answered on this site: How to change environment variables in python? I am quoting the accepted answer: You can set them that way, however $LD_LIBRARY_PATH is read by the loader which has already run before that therefore you must set that one...

Rake not exporting PATH

ruby,path,environment-variables,rake

When using sh from within a Rake task, it spawns a shell and executes the command. The lifetime of environment variables, PATH being one of them, is until the shell exits. So the :make_path task spawns a shell that exports this variable and then exits. Next time a shell is...

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

mysql,git,amazon-web-services,environment-variables,laravel-5

You could create a new .env on your ec2 instance and add all the env vars in there. One option would be ssh-ing into the box and creating the file via vi or cat. Or you could write a script to remotely pull the .env in from an external location....

Set environmental variable in VS12 C#

c#,dll,environment-variables

To programmatically change an Environment variable from within your application, you can use one of the following three commands: Setting the environment variable for only the current process: Environment.SetEnvironmentVariable("<VarName>", "<VarValue>", EnvironmentVariableTarget.Process); Setting the environment variable for the current user: Environment.SetEnvironmentVariable("<VarName>", "<VarValue>", EnvironmentVariableTarget.User); Setting the environment variable for the entire system:...

lapply() emptied list step by step while processing

r,null,scope,environment-variables,lapply

The reason is that the assignment is taking place inside a function, and you've used the normal assignment operator <-, rather than the superassignment operator <<-. When inside a function scope, IOW when a function is executed, the normal assignment operator always assigns to a local variable in the evaluation...

How to set Environment variables permanently in C#

c#,environment-variables

While the program is running, after using Set, the value is returned using Get without any issue. The problem is the environment variable isn't permanent (being set on the system). Thats because the overload of SetEnvironmentVariable that you're using stores in the process variables. From the docs: Calling this...

PATH is not updated when I login

linux,bash,debian,environment-variables,.profile

In your .bashrc file add the following command: PATH="/home/gsamaras/mpich-install/bin:$PATH" Then execute: . .bashrc from you home directory. Now, check you path (or) logout and login....

python override environment variable in local scope

python,perl,environment-variables

using python's with statement: from sys import argv import os class MyPath(object): def __init__(self, newpath): self.newpath = newpath def __enter__(self): self.path = os.environ['PATH'] os.environ['PATH'] = self.newpath return self.newpath def __exit__(self, type, value, traceback): os.environ['PATH'] = self.path if __name__ == "__main__": if len(argv) < 2: print "usage: %s path" % (argv[0],)...

What is the Ruby equivalent of PHP $_ENV?

php,ruby,cgi,environment-variables

Try: ENV.inspect It seems to be a hash that holds what you are looking for....

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

tomcat,logging,tomcat7,environment-variables,log4j2

What you need to do is put the environment variables you want to use in the seten.sh file in the tomcat bin. After you do this, when tomcat starts it will load that environment variable and you will be able to find that variable using the env designation in the...

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

bash,cygwin,environment-variables

It's Cygwin's representation of one of the special environment variables created by the Windows command processor (cmd.exe) in order to track a separate current directory for each drive the same way MS-DOS did. You should also see entries like !C:=C:\Users\Ross Ridge in the output of env. The Windows command processor...

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

linux,memory,apache-spark,environment-variables,config

First, you should know that 1 Worker (you can say 1 machine or 1 Worker Node) can launch multiple Executors (or multiple Worker Instances - the term they use in the docs). SPARK_WORKER_MEMORY is only used in standalone deploy mode SPARK_EXECUTOR_MEMORY is used in YARN deploy mode In Standalone mode,...

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

environment-variables,maven-3,java-home,maven-compiler-plugin

As Jarrod pointed, solution is usage of profiles. Using example provided from maven docs. Profiles can be automatically triggered based on the detected state of the build environment. These triggers are specified via an section in the profile itself. Currently, this detection is limited to prefix-matching of the JDK version,...

How to set global environment variables using shell script .sh

python,shell,ubuntu,environment-variables

According to Ubuntu env variables doc the best way would be A suitable file for environment variable settings that affect the system as a whole (rather than just a particular user) is /etc/environment That's assuming you don't mind having them set for the whole machine....

Using Figaro and Secrets.yml to Manage Env Variables

ruby-on-rails,ruby-on-rails-4,environment-variables,figaro

The gem provides a generator: $ rails generate figaro:install The generator creates a config/application.yml file and modifies the .gitignore file to prevent the file from being checked into a git repository. You can add environment variables as key/value pairs to config/application.yml: GMAIL_USERNAME: Your_Username The environment variables will be available anywhere...

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

c,linux,raspberry-pi,environment-variables,getenv

This shell command: QUERY_STRING='This is my query string' creates a shell variable, not an environment variable. Shell variables are local to the shell process, not passed on to child processes like your a.out. To make it an environment variable, you need to export it: export QUERY_STRING ...

batch variable from user input treated differently

batch-file,menu,environment-variables

Temporary %%variables are only valid within a FOR statement. You are attempting to use %%j outside of the FOR loop. Here are 2 ways to get the desired result. @echo off setlocal EnableDelayedExpansion set something[0]=aaaa set something[1]=bbbb set something[2]=cccc set something[3]=dddd set something[4]=eeee set something[5]=ffff set something[6]=gggg for /l %%i...

Multiple environments for Ruby application

ruby-on-rails,ruby,configuration,environment-variables

You could do something quite like the way rails does it: class AppEnvironment def initialize(env = :production) @name = env.intern end def development? @name == :development end def test? @name == :test end def production? @name == :production end end app_environment = AppEnvironment.new( ENV['APP_ENVIRONMENT'] ) Then you set the environment...

Puppet: Set env variables & boot app - variables undefined

linux,environment-variables,vagrant,puppet

The shell that runs your exec appears not to honor /etc/environment. There is two ways to go about this. Use the envrironment explicitly Write a wrapper script that does a . /etc/environment before invoking the npm proper. Set the needed variables via manifest Pass the environment parameter to the exec...

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

A target also has the ability to perform its execution if (or unless) a property has been set. To make a target sense this property, you should add the if (or unless) attribute with the name of the property that the target should react to. <target name="build-if" if="env.JBOSS_HOME"/> <target name="build-unless"...

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

php,apache,path,ffmpeg,environment-variables

You may put environment variables in the command just like in shell. Examples: shell_exec('PATH=/usr/local/bin:/usr/local/opt/php55/bin:$PATH which ffmpeg'); Alternative solution: In case you do not want to make the code dirty, you may configure your Apache environment variables as follow. Mac: Edit /System/Library/LaunchDaemons/org.apache.httpd.plist and added <key>EnvironmentVariables</key> <dict> <key>PATH</key>...

Log access to environment variables in windows

windows,environment-variables

No, you can't do that. The entire environment gets copied into the process when it gets created - there is no "access event" to log. One alternative would be to reverse-engineer the application (disassemble the code and see what parts of the environment it accesses). You might also be able...

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

shell,environment-variables,zsh,statusbar,tmux

Instead of passing an argument to a script, why not fetch what you need from the script itself? You can use this: tmux display-message -p -F "#{pane_current_path}" That will get pane current path in the script or from outside tmux. If you're going to use bash for the script, here's...

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

linux,bash,shell,environment-variables

Command-line arguments and environment variables both come out of the same pool of space. Set environment variables too long, and you no longer have space for command-line arguments -- and even xargs, which breaks command line invocations down into smaller groupings to fit inside the pool where possible, can't operate...

Docker registry:2.0 overriding configuration options

amazon-s3,docker,environment-variables,docker-registry

I am loading the accesskey and secretkey via environment variables in my docker run command. However, I am specifying my bucket name and region in the config file, and in the process of looking for solutions to your problem, it appears that you must specify the region and bucket name...

Export of PATH not permanent

linux,path,export,global-variables,environment-variables

Yes, many a times that's the problem with doing export PATH. You should append the environment variable directly into your .bash_profile file! This will be permanent and solve your purpose,thereby, making your package used globally without any further problem with the package's path. Append the following to the end of...

Rails environment variables failing to load in model

ruby-on-rails,model,environment-variables,rake

I restarted the server and everything worked fine. Mysterious...

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

You can do that with a simple replacement like this: $f = 'C:\path\to\your.txt' (Get-Content $f -Raw) -replace '\$env:ReplicaOrNewDomain', $env:ReplicaOrNewDomain | Set-Content $f or like this: $f = 'C:\path\to\your.txt' (Get-Content $f -Raw).Replace('$env:ReplicaOrNewDomain', $env:ReplicaOrNewDomain) | Set-Content $f Note that when using the -replace operator you need to escape the $ (because otherwise...

R - get values from multiple variables in the environment

r,environment-variables,value

You can put your operation into a function and then iterate over it: get_my_substr <- function(vecname) levels(as.factor(sub(".*?Amon_(.*?)_historical.*", "\\1", get(vecname)))) lapply(my_vecnames,get_my_substr) lapply acts like a loop. You can create your list of vector names with my_vecnames <- ls(pattern=".list$") It is generally good practice to post a reproducible example in your question....

Environment vars by Power Shell

windows,powershell,environment-variables,windows-8.1

You can try this command: Get-ChildItem Env: Output: Name Value ---- ----- Path D:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\... TEMP C:\DOCUME~1\kmyer\LOCALS~1\Temp SESSIONNAME Console PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PS1;.PSC1 USERDOMAIN WINGROUP PROCESSOR_ARCHITECTURE x86 SystemDrive C: APPDATA C:\Documents and Settings\kmyer\Application Data windir C:\WINDOWS USERPROFILE C:\Documents and Settings\kmyer Also check Windows PowerShell Tip of the Week...

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

environment-variables,mpi

Some MPI implementations have an -x flag for mpirun for this, e.g. OpenMPI: -x <env> Export the specified environment variables to the remote nodes before executing the program. Only one environment variable can be specified per -x option. Existing environment variables can be specified or new variable names specified with...

Python: can't access newly defined environment variables

python,bash,environment-variables

After updating your .bashrc, perform source ~/.bashrc to apply the changes. Also, merge the two BONSAI-related calls into one: export BONSAI=/home/me/Utils/bonsai_v3.2 UPDATE: It was actually an attempt to update the environment for some Eclipse-based IDE. This is a different usecase altogether. It should be described in the Eclipse help. Also,...

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

java,environment-variables

You could use System class's getenv method like: String path = System.getenv("CONFIG") + "/app/users.json" So you could get whatever path you set in CONFIG variable and then you could append further path to it....

Pipe in for loop breaks double quoted variables

batch-file,for-loop,pipe,environment-variables,double-quotes

Thanks to Dave Benham's answer on a related issue I've found the solution! It appeared to be a specific FOR /F bug in WinXP, and guess what, here I'm still on WinXP. To fix the main offender, the curl-pipe-jq-for-loop, I had to put ^" in front of and after the...