environment-variables

Print a variable with multi-line value in shell?

梦想与她 提交于 2020-06-22 08:32:05
问题 In Bash (or other shells) how can I print an environment variable which has a multi-line value? text='line1 line2' I know a simple usual echo $text won't work out of the box. Would some $IFS tweak help? My current workaround is something like ruby -e 'print ENV["text"]' . Can this be done in pure shell? I was wondering if env command would take an unresolved var name but it does not seem to. 回答1: Same solution as always. echo "$text" 回答2: export TEST="A\nB\nC" echo $TEST gives output: A\nB\nC

Error env: ruby_executable_hooks: No such file or directory while running Slather on Jenkins

随声附和 提交于 2020-06-18 20:25:41
问题 I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server. Here is the script I am running through slather slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home

Error env: ruby_executable_hooks: No such file or directory while running Slather on Jenkins

不想你离开。 提交于 2020-06-18 20:24:06
问题 I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server. Here is the script I am running through slather slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home

environment variable not set in makefile

左心房为你撑大大i 提交于 2020-06-18 11:16:30
问题 I want to trigger unit test and integration test in a Makefile, my current implementation is like this: all: unittest integration unittest: $(ECHO) @echo 'Running unittest' @unset TYPE @nosetests integration: $(ECHO) @echo 'Running integration test' @export TYPE=integration @nosetests but I'm having problems with setting environment variables, when I run make integration , the TYPE environment variable would not be set, if I set the environment variable manually with export TYPE=integration ,

zsh can neither find nor execute custom user scripts in ~/bin although they are executable and in the $PATH environment variable

こ雲淡風輕ζ 提交于 2020-06-17 09:45:13
问题 Problem: I have recently upgraded from macOS Mojave 10.14.6 to macOS Catalina 10.5.5. Now that zsh is the default shell, I migrated my .bashrc to .zshrc : Aliases work fine. But for some unexplainable reason, my custom user scripts in ~/bin/my/ and ~/bin/dev/ are not completed by autocompletion cannot be evoked when typed entirely, I then get zsh: command not found: myScript.sh Investigation & Troubleshooting: When changing the shell back to bash, everything still works, so data-loss

Search for a file in $PATH on Linux in C

与世无争的帅哥 提交于 2020-06-17 05:30:35
问题 I would like to test whether GNUPlot is installed on the system on which my program is running. For that, I figured I'll test for the existence of the gnuplot executable in the user's install locations through stat() call. However, I don't know how to read the $PATH environment variable in C so I can test for the existence of the file in those locations. 回答1: To read the PATH environment variable, use getenv("PATH") . However, if you just want to run gnuplot if it's available, and perform

Search for a file in $PATH on Linux in C

不打扰是莪最后的温柔 提交于 2020-06-17 05:28:25
问题 I would like to test whether GNUPlot is installed on the system on which my program is running. For that, I figured I'll test for the existence of the gnuplot executable in the user's install locations through stat() call. However, I don't know how to read the $PATH environment variable in C so I can test for the existence of the file in those locations. 回答1: To read the PATH environment variable, use getenv("PATH") . However, if you just want to run gnuplot if it's available, and perform

Environment variables are always undefined in VueJs application

喜欢而已 提交于 2020-06-17 03:56:45
问题 I am trying to create some environment variables for my application but they are always undefined for some reason. I followed some guides and did the following Created a file called .env added the following into the file VUE_APP_MY_ENV_VARIABLE = myValue In my App.js file added the following: beforeMount(){ console.log(process.env.VUE_APP_MY_ENV_VARIABLE) } ran npm run serve but the variable always comes as undefined. I also ran npm run build and npm run serve multiple times but it ain't

How to send environment variables using curl

百般思念 提交于 2020-06-16 03:30:12
问题 I am trying to use slack to notify when a build is complete or if a build fails on GitlabCI. What I also wanna be able to do is append a predefined environment variable $GITLAB_CI_COMMIT_TITLE so along with the build notification I also know which build with what commit has completed/failed In short, This works "curl -X POST -H 'Content-type: application/json' --data '{\"text\":\" Client Staging build complete. \n\"}' https://hooks.slack.com/services/T04KY5T7G/BBA4Z4BQC

create-react-app — how to set EXTEND_ESLINT to true?

那年仲夏 提交于 2020-06-11 10:42:22
问题 I have created a .env file in my project root but I'm new to working with environments / variables and so I'm unsure how to integrate the file so I can override the stock, non-ejected react-app eslint settings. // My .env file has just this EXTEND_ESLINT = "true" The c-r-a docs explain what the variable is, but not now to set it to true. Also, the section on 'Extending the ESLint config' is helpful only for once the var is set to true. // stock create-react-app package.json "scripts": {