environment-variables

Inheriting aliases inside UNIX /usr/bin/script

只愿长相守 提交于 2020-01-14 13:49:24
问题 The UNIX "/usr/bin/script" command will create a running transcript of your shell session (see "man script" for more info). However, when inside a script instance, it seems to forget the parent shell's env vars, aliases, etc. The following example demonstrates how the "ll" alias I define is ignored inside "script": zsh> mkdir temp zsh> cd temp zsh> alias "ll=ls -alF" zsh> ll total 24 drwxr-xr-x 2 me mygroup 4096 Feb 18 13:32 ./ drwxr-xr-x 28 me mygroup 8192 Feb 18 13:32 ../ zsh> script a.out

Passing System Env variable into Jenkins Slave

ε祈祈猫儿з 提交于 2020-01-14 08:05:10
问题 This is starting to drive me crazy .. but it seems like I am out of luck to figure it out by myself :/ I need to set up a mechanism to share string value between two slaves, for example, named slave A and slave B . Currently most closest one I have found is this SO Question: Jenkins Slave Environment Variable Refresh But it still aims to enable access in buildscripts, not in the Slaves environment variable itself. (related SO Question: How are environment variables used in Jenkins with

R environments and function call stacks

独自空忆成欢 提交于 2020-01-14 07:58:07
问题 I am trying to use get in series of function calls, but the lookup of the object names seems to skip environments. For example: foo <- 1 # variable in .GlobalEnv getter <- function(x) {get(x)} getter("foo") # returns 1, which is expected f1 <- function() { foo <- 2 # local variable in the function scope getter("foo") } f1() # still returns 1, would've expected to return 2 Why is it that calling f1 returns the foo in the global environment and not the foo in the calling function's environment?

spring-boot camel case nested property as environment variable

与世无争的帅哥 提交于 2020-01-14 07:49:09
问题 I have a spring boot application and want to set, though environment variables, in a class annotated with @ConfigurationProperties a second level nested property which is camel case. Here is an example of the class: @SpringBootApplication @EnableConfigurationProperties(SpringApp.Props.class) @RestController public class SpringApp { private Props props; @ConfigurationProperties("app") public static class Props { private String prop; private Props nestedProps; public String getProp() { return

Why I can't print out environment variables in gdb?

送分小仙女□ 提交于 2020-01-14 07:32:30
问题 #include <unistd.h> #include <stdio.h> extern char **environ; int main(int argc, char *argv[]) { int i = 0; while(environ[i]) { printf("%s\n", environ[i++]); } return 0; } Here's my ops: (gdb) n 8 printf("%s\n", environ[i++]); (gdb) p environ[i] Cannot access memory at address 0x0 (gdb) n LOGNAME=root 7 while(environ[i]) { As you can see, printf can print out environ[i] ,but p environ[i] gives me Cannot access memory at address 0x0 ,why? 回答1: gdb resolves the wrong environ symbol. I don't

setting environment variables programmatically

天大地大妈咪最大 提交于 2020-01-14 07:05:13
问题 In R, I can set environment variables "manually", for example: Sys.setenv(TODAY = "Friday") But what if the environment variable name and value are stored in R objects? var.name <- "TODAY" var.value <- "Friday" I wrote this: expr <- paste("Sys.setenv(", var.name, " = '", var.value, "')", sep = "") expr # [1] "Sys.setenv(TODAY = 'Friday')" eval(parse(text = expr)) which does work: Sys.getenv("TODAY") # 1] "Friday" but I find it quite ugly. Is there a better way? Thank you. 回答1: You can use do

setting environment variables programmatically

好久不见. 提交于 2020-01-14 07:05:11
问题 In R, I can set environment variables "manually", for example: Sys.setenv(TODAY = "Friday") But what if the environment variable name and value are stored in R objects? var.name <- "TODAY" var.value <- "Friday" I wrote this: expr <- paste("Sys.setenv(", var.name, " = '", var.value, "')", sep = "") expr # [1] "Sys.setenv(TODAY = 'Friday')" eval(parse(text = expr)) which does work: Sys.getenv("TODAY") # 1] "Friday" but I find it quite ugly. Is there a better way? Thank you. 回答1: You can use do

Load different .env file with a Symfony 4 command

耗尽温柔 提交于 2020-01-14 03:03:59
问题 .env file is parsed when running a Symfony 4 command (if dotenv is available). This is working fine when developping, but also, I want to test my code (so another environment), hence I need to load another .env file. I love what Docker did to run a container: docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash So I am looking to achieve same thing with Symfony: php bin/console --env-file ./.env.test right now, I am doing this: export $(grep -v '^#' .env.test | xargs) &&

Load different .env file with a Symfony 4 command

孤街醉人 提交于 2020-01-14 03:03:23
问题 .env file is parsed when running a Symfony 4 command (if dotenv is available). This is working fine when developping, but also, I want to test my code (so another environment), hence I need to load another .env file. I love what Docker did to run a container: docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash So I am looking to achieve same thing with Symfony: php bin/console --env-file ./.env.test right now, I am doing this: export $(grep -v '^#' .env.test | xargs) &&

C++ - Using environment variable in property sheet for Visual Studio 2010

假装没事ソ 提交于 2020-01-13 19:12:30
问题 I want to set up a project which uses OpenCV. So basically, I have to add a new property sheet using the property manager from Visual Studio 2010. Basically, I have to add the path to my include and lib folders in order to make OpenCV functional. I want to put my project in a git repository and I don't want to change the paths in my property sheets every time. Is there a way of using a system variable in my property sheet with the path to the build folder of OpenCV? If there exist a way of