Questions tagged [environment-variables]

Environment variables are configuration options that can be set in a shell or other similar environments. All programs started from within the shell can read them and configure themselves.

Environment variables are key-value-pair configuration options like KEY=valueor FOO=bar. Environment variables allow you to configure a program before it gets executed and without the need to store these variables in proprietary configuration files.

They are present on all POSIX systems (Unix, Linux, BSD, Mac OS, DOS, Windows, ...). Environment variables can be set by any shell and read by nearly any programming language.

Some programming languages allow you to set Environment variables, but they only persist within the current process. You can't set them to be visible by the calling shell. So they are not useful for inter-process communication.

410 questions
-1
votes
1 answer

How can I fix the error Undefined variable: _ENV in /home/nginx/domains/mydomain.com/system/Config/BaseConfig.php?

I am trying to install a Codeigniter application in pure NGINX + PHP-FPM environment but it was previously developed in apache . After adding all the proper rules to Nginx in order to work with Codeigniter I am being faced with this error related to…
-2
votes
3 answers

See someone unused environment variable

Let's say I log in as Bob to host server. Then i do : export MYSEC='secret' Let's say Alice has access to the same host and also sudo permissions. How can Alice see the value of MYSEC? Note : let's say Bob never closes the session so the value…
Matias Barrios
  • 213
  • 3
  • 12
-2
votes
1 answer

Permission denied when executing perl via sudo

Command: ssh user@testhost "sudo -u tester env PERL5LIB=/home/tester/perl5/lib/perl5 /home/tester/perl5/bin/testperl" Result: Can't locate testperl.pm: Permission denied at /home/mogile/perl5/bin/testperl line 15. How can I fix the problem?
petertc
  • 2,500
  • 1
  • 15
  • 10
-3
votes
1 answer

searching file for last matching line, then put 3rd word of this line into a variable

i have a logfile, a script checks this log-file every hour it shall pack the 3rd word of the last matching line into a variable but i didn't manage it to work yet .. logfile: 2018-11-18 22:27:10 1542576430 c2- restarted=true 2018-11-19 00:14:34…
nyma3
  • 1
  • 2
-3
votes
2 answers

How to set environment variables

Say, I would like to change my editor system-wide to nano. I was doing this with echo 'export EDITOR=/usr/bin/nano' >> /etc/bashrc As I learned, it was a bad idea, because if you accidentally omit one >, you will overwrite bashrc and won't be able…
Nickolai Leschov
  • 457
  • 4
  • 8
  • 22
1 2 3
27
28