A set of dynamic variables that can affect the running processes.

learn more… | top users | synonyms (1)

1
vote
1answer
22 views

cannot get screen command to execute code containing DISPLAY=:0

I am trying to ssh into a remote machine and run a shell script, which opens a GUI. I want the GUI to open on the remote machine and remain open (so I am using DISPLAY=:0 nohup). I tried: ssh -t ...
0
votes
3answers
2k views

TERM variable in chroot

I've created a chroot with the help of jailkit and now I'm trying to install some other libraries and tools. First I tried to install clear library. I've copied the file from the /bin folder and ...
1
vote
2answers
54 views

Why does environment variables persistance breaks the PATH var

I tried to persist the environment variables for ORACLE in RedHat using /etc/environment It cleared my PATH variable, no command was recognized afterwards. Why does it happen, since just ...
3
votes
1answer
25 views

How to temporarily change locale for sudo?

To change the locale of the current user like export LANG=en_US.UTF-8. But this environment variable doesn't affect the root user. When I use sudo the display language remains default. How can I ...
0
votes
0answers
15 views

Pip managed python extending distribution packaged modules

I am looking for recommendations on extending the python library managed by my arbitrary distribution with packages available via PPI. Basically I have been working with a distro managed installation ...
0
votes
2answers
6 views

How can i get an overview about env (environment variables) of all users on a system?

How can i get an overview about env (environment) of all users on a system? Status: i've got over 600 user in passwd, but each of them could have a env variable for a specifec project path (~10 ...
14
votes
5answers
26k views

Script to change current directory (cd, pwd)

I want to run a script to simply change the current working directory: #!/bin/bash cd web/www/project But, after I run it, the current pwd remains unchanged! How can I do that?
1
vote
2answers
38 views

What sets the $SHELL environment variable?

Where is the environment variable $SHELL first set on a UNIX system? How can I find and print all of this type of default settings of my terminal?
67
votes
4answers
8k views

Is there a “.bashrc” equivalent file read by all shells?

Is ~/.bashrc the only place to specify user specific environment variables, aliases, modifications to PATH variable, etc? I ask because it seems that ~/.bashrc seems to be bash-only, but other ...
1
vote
1answer
20 views

Where are the places the PROMPT_COMMAND variable could be set?

I installed drush and as part of the installation it makes some changes to the PROMPT ... # Optional. Enrich the bash startup file with completion and aliases. drush init ... Whenever I execute an ...
1
vote
1answer
16 views

Pass Environment Variable to Sudo AWS ec2 sudo node

I am new to linux and AWS. I have a node.js server running on an EC2 instance. I am running the following command to keep it running endlessly and on port 80: $ sudo node app.js & Now when I ...
0
votes
2answers
38 views

How to properly set environment variables in Debian Jessie?

I can't figure out how to set environment variables properly, even though I tried to follow https://wiki.debian.org/EnvironmentVariables. I've added this to ~/.bashrc: if [ -f ~/.bash_profile ]; ...
2
votes
1answer
20 views

Exporting a variable so it appears in a script sourced through sudo

I have a bash script/s which has a "main" script which is run as sudo. Variables are declared in this script. Then it sources another commands.sh script, however this script uses sudo to drop back to ...
3
votes
1answer
25 views

Can't export environment variables on X session start

My setup is: Debian testing (stretch), up to date LightDM with autologin enabled Awesome window manager bash, in ROXTerm or XTerm I don't seem to be able to set own environment variables and get ...
0
votes
1answer
41 views

“export VAR=thing && someCommand” reports “export: `&&': not a valid identifier”

I'm trying to set an environment variable and execute a command in a single line, like this: export PUB_CACHE=/app/src/.pub-cache && dart-sdk/bin/dart server.dart (Don't ask why... it's ...
0
votes
2answers
46 views

Get the latest value of an environment variable is a bash shell script

I wonder how can we get the latest value of an environment variable in a bash shell script. Problem I am having is, I have a environment variable which can be changed externally multiple times. But ...
3
votes
1answer
73 views

how to: Please sudo, do _not_ setup any environment, especially $SUDO_USER?

I want to start a process as another uid and it should not need any information from $(env), so I strip the environment prior to the sudo -u powerlessuser /bin/processCmd, that is I run this env -i ...
0
votes
2answers
1k views

Installing netbeans on Scientific Linux- NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread “main”

I'm installing netbeans 8.0.1 on Scientific Linux. I have executed the installer .sh but I get the error: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main" ...
0
votes
0answers
18 views

How to make cron job which suspends computer before specified time of the day

I am trying to make script which suspends computer if it is used before specified time of the day or if it is used too long. #! /bin/bash ...
11
votes
5answers
30k views

Export an env variable to be available at all sub shells, and possible to be modified?

Suppose I have export MY_VAR=0 in ~/.bashrc. I have an opened gnome terminal, and in this terminal, I change $MY_VAR value to 200. So, if I do echo $MY_VAR in this terminal, 200 is shown. Now, ...
0
votes
1answer
881 views

How to specify a custom include directory in Debian?

I am trying to compile my program on a Debian system via ssh and without root privileges. PRETTY_NAME="Debian GNU/Linux 7 (wheezy)" NAME="Debian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" I ...
6
votes
2answers
123 views

Strange environment variable !::=::\ in Cygwin

Using Cygwin, I installed Environment Modules by downloading source code, running configure, make, and make install. Every time I run a module command, I get: init.c(718):WARN:165: Cannot set TCL ...
2
votes
2answers
47 views

How to store the printout of the last command in a shell variable in urxvt/zsh?

I'd like to have the printout (stdout and stderr) of the last command run within zsh available in a variable ready to use grep, etc on it.
0
votes
2answers
45 views

Systemd bash builtins

I have an application that needs to use the commando source for setting his environment file. [Unit] Description=Programname After=syslog.target network.target [Service] User=root ...
0
votes
0answers
15 views

Environment Modules: installing software

I understand how Environment Modules work, having used them before. I have read the various help pages, and I understand how to write a module file. My question is explicitly about the various ...
0
votes
1answer
25 views

Using export USER=myName doesn't change the output of whoami

I saw this example $ whoami MatsP $ g++ -Wall -std=c++0x getenv.cpp $ ./a.out MatsP $ export USER=DonaldDuck $ ./a.out DonaldDuck but for me it doesn't work. I am in a Debian machine. I used ...
1
vote
3answers
57 views

An environment variable with equal sign and && operator

I want to create an environment variable for this command: git --git-dir= echo test-folder/.git/ add Steps-to-follow.txt && git --git-dir= echo test-folder/.git/ commit This is a relevant ...
6
votes
1answer
1k views

Locale environment variable settings do not take effect

I have a Debian 6 (64-bit) VPS where I cannot seem to get the locale environment variables LANG and LC_* set. (Everything below as root). vps:~# locale -a C POSIX en_US.utf8 nl_NL.utf8 vps:~# locale ...
0
votes
1answer
2k views

Runtime parameters for a systemd service

I am a little confused about how runtime parameters are normally supplied to a systemd service. The general idea I have is that the following happens: There is a file that contains the environment ...
16
votes
1answer
19k views

How can I make variables “exported” in a bash script stick around?

I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as $EC2_HOME, using a script. I have have a shell script set up like this: #!/bin/sh export ...
1
vote
1answer
21 views

How can I set kerberos principal in environment automatically on the remote host?

I use both legacy krsh and ssh to login to a variety of boxes for root administration, as do several colleagues of mine. We all keep different history files by use of a variable calculated by running ...
1
vote
1answer
34 views

how to get or reflect the name of the bash function which is called? [duplicate]

i did not yet found a solution to this. Anyone a hint? i sometimes write bash functions in my shell scripts and i love to have my scripts being verbose, not just for debugging. so sometimes i would ...
0
votes
1answer
17 views

Substitute variable in value of chpst loaded environment variable

If I use chpst to load environment variables like: env BAR=baz chpst -e envdir mycommand and in envdir I have a file envdir/FOO with contents foo$BAR is there a way so that for mycommand the ...
2
votes
2answers
48 views

Updating shell functions and aliases through environment variables

Say we define the following shell function and alias in .zshenv: export VARIABLE_A='original' function my_function() { print $VARIABLE_A } export VARIABLE_B='original' alias my_alias="print ...
1
vote
1answer
24 views

Which shells have functions where “local” does not alter exported variables for child processes?

In the example below, an exported variable is re-set as local in a function. Bash, Zsh, Fish don't pass on the original value to the child process. Are there any shells that make local affect the ...
0
votes
1answer
35 views

How to set multiple env variables from stdout pipe

I have a bunch of piped shell commands that give some env output. I want to set these as env variables for an additional command to add to the chain Kevins-MBP:ops kevzettler$ eb printenv | tail -n ...
2
votes
3answers
125 views

Bash one-liner to temporarily append path for chained commands without additional bash invocation?

Consider this: $ cd /tmp $ echo "echo YES" >> prog/myprog $ chmod +x prog/myprog $ prog/myprog YES $ myprog myprog: command not found I can temporarily modify PATH to call myprog by name like ...
0
votes
1answer
28 views

.zshenv not sourced on ssh login?

According to the docs .zshenv is sourced on all invocations of the shell, unless the -f option is set. It should contain commands to set the command search path, plus other important environment ...
3
votes
4answers
102 views

Is there a nice way to set directory/project local environment variables?

I have been working on several projects, and they require different environment variables (e.g., PATH for different versions of clang executables, PYTHONPATH for several external modules). Whenever I ...
127
votes
3answers
75k views

What does “LC_ALL=C” do?

What does the C value for LC_ALL do in Unix-like systems? I know that it forces the same locale for all aspects but what does C do?
11
votes
2answers
13k views

Exporting a variable with dot (.) in it

How to export a variable which has dot in it. I get 'invalid variable name' when I tried : export my.home=/tmp/someDir -ksh: my.home=/tmp/someDir: invalid variable name Even escaping metacharacter ...
1
vote
2answers
62 views

Why some commands don't load user environment when executed with ssh? (while other do)

On a target machine (OS X El Capitan) I have brew in /usr/local/bin. When I try to get brew's path I get no result: # ssh vagrant@127.0.0.1 -p 2222 which brew # Troubleshooting: brew is in ...
7
votes
4answers
1k views

How to start a script with clean environment?

I tried the following but it doesn't seem to work: $ cat script.sh #!/bin/env -i /bin/sh /bin/env $ script.sh /bin/env: invalid option -- ' ' Try `/bin/env --help' for more information.
364
votes
8answers
675k views

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this. This way: export ...
2
votes
3answers
98 views

Trying to understand .bashrc, env, and export

Disclaimer: Using bash. I just need some confirmation / correction on my understanding of these things: env is basically displaying the current environmental variables that are accessible to my ...
1
vote
1answer
58 views

What is the LESS environment variable to man and how is it set up?

What is the LESS environment variable used for in man? I found that it could make the output of man jump to a match to the pattern stored in LESS. What about when there are several matches? How is ...
5
votes
2answers
35k views

bash setenv command is not found

every body I am new in centos server I am getting a error while using following command setenv CLASSPATH /path/mysql-connector-java-ver-bin.jar:$CLASSPATH error is bash setenv ...
3
votes
1answer
42 views

Difference between logname and $LOGNAME

While reading about environment variables, the one I came across was LOGNAME, I'd like to know the difference between this variable and whatever the command logname returns - as both of them did ...
2
votes
4answers
205 views

Is there a CLI tool that would prettify a JSON string [closed]

On my host I enter the following, which returns a bunch of information which isn't particularly easy to read at the CLI. echo $ENV_VAR | base64 --decode Is there a way to format it? This is a ...
5
votes
1answer
973 views

Inherit environment variables in systemd Docker container

I have a Docker container running systemd. I want to pass environment variables to applications under it. When I start systemd from within Docker (/sbin/init as command line), Docker exposes ...