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

learn more… | top users | synonyms (1)

0
votes
2answers
35 views

Which location does shell assign normal variable?

As you know, bash shell itself is also process. If I use command export a=c, then shell dynamically allocates variable a into location where environment variables are reside.(This environment section ...
1
vote
0answers
18 views

Setting the LANG environment variable for xfce

I am on a multi user Debian Stretch system which has en_US.UTF-8 as default locale, but I want de_DE.UTF-8 for my user. I was able to set it for terminals, by adding export LANG=de_DE.UTF-8 to ...
0
votes
2answers
46 views

Correct way to set PERMANENT environment variables from script

I want to do a very simple install process for my app framework. I've got everything working, but I want to set two environment variables. I want to update the PATH and also set a HOME variable. I ...
0
votes
0answers
11 views

Run VNC at startup as root - HOME variable not being set

I have the following code in /etc/init/vnc.conf (used by Ubuntu 14.04's Upstart): description "VNC on start" author "user129013" start on runlevel [2345] exec /root/vnc The job is running ...
0
votes
2answers
42 views

bash command to print gcc environment variables

Is there a way to print all the GCC environment variables(path for include directory, library) from the command line, i.e something similar to 'printenv' that gives all bash environment variables ?
2
votes
2answers
26 views

Why does .pam_environment not include $HOME in my new path?

I created a /home/myname/.pam_environment file containing PATH DEFAULT=${PATH}:${HOME}/apps/flyway But my new path doesn't end with /home/myname/apps/flyway. Why not? $ echo $PATH ...
0
votes
2answers
29 views

$USER environment variable not changed to root

The USER env variable is unchanged after gaining root access. [user1@comp]$ echo $USER user1 Logged in the system as 'user1'. Now check the output after gaining root access. [user1@comp]$ su ...
3
votes
2answers
73 views

Why is #!/usr/bin/env bash not working on my system?

I ran into some issues when running some installation scripts where they complained of bad interpreter. So I made a trivial example but I can't figure out what the problem is, see below. ...
0
votes
0answers
15 views

How to edit $PATH? [duplicate]

After searching, I can't still figure out how to edit $PATH. Now its value is: ...
0
votes
1answer
16 views

bash: /home/hadoopuser/hadoop/sbin: Is a directory

I am in Ubuntu 14.04 LTS. Based on how to set a Hadoop cluster I am executing this: # Add Hadoop bin and sbin directory to PATH export PATH=$PATH:$HADOOP_HOME/bin;$HADOOP_HOME/sbin where I know ...
1
vote
0answers
20 views

Piping to 'tee' commands prevents changes in environment variables

I have a csh script using which I modify certain environment variables and echo values of these environment variables from within this script. I source this from another script: source ...
1
vote
0answers
36 views

Setting environment variable using shell script

I am using csh scripts for some automation purpose. I have a number of scripts, and the beginning of all of which I need to set a fixed set of environment variables. |----SCRIPT 1---| |----SCRIPT ...
0
votes
0answers
9 views

Export variable failed when I was compiling NETCDF

I'm compiling NETCDF on Linux. After configure, make,make install, I have already install NETCDF on /disk3/lly/lib/netcdf-4.1.3. Then, using vim ~/.bashrc,edit: export ...
6
votes
1answer
471 views

What is a *.sorted command and why doesn't it work in my bash?

In a Bash Guide for Beginners (sec. 3.2.1.2. Local variables) there is an example command which is supposed to list all of the local variables, that are not in enviromental variables, or so I think: ...
1
vote
1answer
45 views

Setting env variable through script on current session

Is there a possible way of setting env variable through script on current session. I have tried source option. But this works on the shell not through script. here is my script content source ...
6
votes
3answers
185 views

How can I un-export a variable, without losing its value?

Let's say I exported a variable: foo=bar export foo Now, I'd like to un-export it. That's to say, if I do sh -c 'echo "$foo"' I shouldn't get bar. foo shouldn't show up in sh -c's environment at ...
3
votes
1answer
34 views

How bash changes environmental variables on-the-fly?

As we know, it's only possible to change the environmental variable set of a process in some time after the fork() system call and before exec(), e.g. manipulation like this is possible only from ...
2
votes
3answers
139 views

get environment variable by variable name? [duplicate]

For example, I have a variable: env_name="GOPATH" Now I want to get the environment variable GOPATH as if like this: echo $GOPATH How can I get $GOPATH by $env_name?
8
votes
2answers
142 views

Variable assignments affect present running shell

While writing some code I found out that this line: $ TZ="America/Los_Angeles" date; echo "$TZ" Thu Dec 24 14:39:15 PST 2015 Correctly gives the actual time at "Los Angeles" and that the ...
6
votes
1answer
88 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 ...
6
votes
4answers
275 views

Assign multiple environment variables to a single variable and expand them on command

Let's say I want to repeat the same string of environment variables before running various incantations of a command if [[ some_thing ]]; then TZ=GMT LC_ALL=C LONG_ENV_VAR=foo my_command elif [[ ...
1
vote
1answer
19 views

Programs don't see fish environment variables

If I set the EDITOR environment variable to emacs in bash, running crontab -e will open the crontab in emacs. When I set it in fish with set -U EDITOR emacs crontab opens with vim. What can I do ...
0
votes
0answers
17 views

How to make versions consistent

I'm using OS X 10.10, and IIRC I've installed bash and other GNU utilities using brew. The output of which bash is /usr/local/bin/bash, and it's version is 4.3, however the env variable SHELL points ...
1
vote
1answer
73 views

How to print the total available space percentage on a specific file system in both linux and solaris?

I've searched for an answer to this question and I found that this command: df /dev/sda1 | awk {print '{(100 -$5 )}' | tail -1 | sed '/s/$/%/g' does the job pretty well on my linux system but I ...
1
vote
0answers
28 views

Tmux has different environment variables? [closed]

I'm on a RHEL 6 system and I recently noticed I was running into proxy issues when running commands in tmux. When I echo $HTTP_PROXY in tmux, I get nothing. But, if I open a terminal on its own ...
1
vote
1answer
68 views

can one use script commands in systemd Environment field?

I've got a docker-compose file that I use to start up several containers for my service. One of these containers requires an environmental variable to be set (the public ip of the server, to be ...
3
votes
4answers
48 views

Bash command substition with environmental variable

I have this code in bash #!/usr/bin/env bash DB_NAME=$(CORE_CONFIG=core.config.core_test python -c "from core import config; print config.DATABASE['db_name']") What I actually want is: ...
4
votes
1answer
42 views

Is there a way of setting the library search path temporarily

We deploy our application with all the necessary dependencies in one directory. Our application sets LD_LIBRARY_PATH to this location. Some of the libraries (for instance OpenSSL) are also present at ...
1
vote
1answer
31 views

Relation between shell start up processes and environment of parent process

"How are shell variables related to the environment that a process started by the shell has on start-up?" I read If processes inherit the parent's environment, why do we need export? My current ...
0
votes
0answers
13 views

Supervisord fails to run a program

I've a program that I try to run with supervisord but keep failing. The following is supervisord configuration: $ cat /etc/supervisor/conf.d/application.conf [program:application-web-1] command=env ...
0
votes
0answers
31 views

Custom GCC installation - how should I set my environment variables?

After some pains I was finally able to build me a gcc 4.9.3 (I don't have root on the machine I'm working on, and Fedora 22 doesn't package gcc 4.9 anyway). And it even works, i.e. using it to compile ...
3
votes
1answer
77 views

To export or not to export bash PS1 variable

I just spent a lot of time reading up on login and interactive shells and why one should or should not set environment variables, shell functions, etc. in the various profile and bashrc files. In this ...
1
vote
1answer
28 views

Bash - Shell variable gets promoted to environment variable in child bash process

Question In Bash, shell_variable=value bash child_command makes the shell_variable an environment variable in the child_command. Is this a build-in shell (sh and bash) feature to promote a shell ...
3
votes
1answer
26 views

Why don't locale variables show up in the output of env or printenv?

The locale command prints a list of environmental variables containing info related to the users locale: $locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" ...
1
vote
1answer
38 views

How do I find the libraries this program needs for its environment variable?

I am trying to set up the program NASAView, for viewing PDS files. The instructions say Set the LD_LIBRARY_PATH Environment Variable The LD_LIBRARY_PATH environment variable is used to ...
1
vote
1answer
103 views

Error when exporting the result of a valid command as a bash variable

I'm trying to export the result of a command line as en environment variable. Here is how I'm doing it: group_id=$(aws ec2 describe-security-groups --filters Name=group-name,Values=${group_name} \ ...
2
votes
1answer
22 views

Make webserver reload the system wide environment variables

I made changes on the /etc/environment file and want the webserver user www-data to benefit from them without rebooting the server. It seems that, in order to reload the /etc/environment file, I only ...
2
votes
1answer
44 views

How to not show path after cd command with CDPATH set?

Setting the CDPATH variable is very useful, but it results in some not very nice result: each time I use the cd command, the full path of directory I want to move is printed. For example, if I am in ...
0
votes
0answers
25 views

Using 'export' and 'xargs' in order to export environment variables from an separate file [duplicate]

I have a dev.env file that contains a number of environment variables. dev.env: APPLICATION_URL=http://localhost:8080 APPLICATION_DOCKER_IP=$(docker-machine ip default) ...
2
votes
1answer
48 views

Share environment variables with www-data

I have a set of environment variables, which is created with a shell script config called from my ~/.bashrc. Having a new user www-data running a local webserver (with lighttpd), I need it to benefit ...
0
votes
0answers
28 views

What environment variables to set when building and installing as regular, non-root user?

Scenario: Using GNU/Linux tools, I want to configure, make, and install to $HOME/custom as a regular, non-root user. Are the following Bash environment variables reasonable? export ...
3
votes
4answers
111 views

how to use sed when a variable contain '/' in it?

I have the following line to execute in a script and that delete two lines above it. But now my $TEST variable contain values like '/DATA/test10' and my variable ID contain '10'. How can i use this ...
3
votes
1answer
78 views

recreate shell invocation

Does a running shell have a mechanism to recreate its invocation? I sometimes make changes to variables or my profile and have to manually source the startup files to make things run again, for ...
3
votes
4answers
248 views

How to show an environment variable's current value?

When I check on my system's environment, a lot of environmental variables will pop up. How can I just search for a particular variable? A book I'm reading says: Sometimes the number of variables ...
1
vote
1answer
116 views

Why does bash clear OLDPWD when a child script is started?

OLDPWD is exported and passed to any children, but bash apparently clears OLDPWD whenever a child script is started: $ cd /etc $ cd $ perl -e 'print "<$ENV{OLDPWD}>\n"' </etc> $ ksh -c ...
6
votes
1answer
255 views

`env foo=bar echo $foo` prints nothing

I think I'm having a massive brainfart. I would expect env foo=bar echo $foo ...to print bar, but I get an empty line instead. Wat. The same happens if I use the bash syntax: foo=bar echo $foo
0
votes
2answers
99 views

It's safe to remove /var/log files

Today i was freeing my space in my Linux mint 17. In Disk analyzer i found that /var/log uses 54+ GB. So what does /var/log used for ? is it safe to delete /var/log ?
1
vote
1answer
50 views

Can't vi in single user mode

Forgive my ignorance, but I have the following problem: In DragonflyBSD, I need to edit /etc/rc.conf in single user mode, but # mount -u / # mount -a # vi /etc/rc.conf vi: unknown: unknown ...
1
vote
1answer
145 views

bash set variable with colon (:) and dash (-) in it (as used by lftp)

so lftp uses some weird shell variables, like the following: xfer:log-file = 1 sftp:connect-program = “ssh -a -x -i keyfile” how would I set these variables? I've tried using set, and env; as well ...
1
vote
2answers
76 views

Arrays in Zsh. Check if any of the following variables is not defined

Say we have a set of variables that we want to test if they are defined, and set a condition if any of them are not. I am thinking of proceeding with something like the following: #!/usr/bin/env zsh ...