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

learn more… | top users | synonyms (1)

0
votes
0answers
20 views

JCE provider usable as root but not regular user

I am trying to install a new JCE provider and have done the following - Copied the provider.jar file to $JAVA_HOME/jre/lib/ext Updated $JAVA_HOME/jre/lib/security/java.security with the line ...
1
vote
1answer
22 views

Finding the length of a terminal session

I'm attempting to create my own bash script to output the length of the current terminal session, as well as do various other things with said length. The problem I'm running into, is that in the ...
6
votes
2answers
376 views

Why does changing $PATH affect child shells, but changing $foo not?

$ unset foo $ unset bar $ echo $foo $ echo $bar $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games $ foo=a $ bar=b $ export bar $ echo $foo a $ ...
13
votes
4answers
708 views

How to pass a password to a child process?

Passing a password on command line (to a child process started from my program) is known to be insecure (because it can be seen even by other users with ps command). Is it OK to pass it as an ...
1
vote
1answer
34 views

How to set a path variable without root acess? [duplicate]

My college currently uses a very old (like 3 years old) openJDK 1.7 distribution. And being a student, obviously I don't have root privileges. I wanted to use a much later version downloaded a much ...
1
vote
1answer
17 views

How to change the tmp directory used by a specific service user?

I want to change the temporary directory used by a specific user (jenkins in my case). The problem is that this needs to be in effect for any process running as Jenkins user and changing it in ....
6
votes
1answer
521 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: ...
0
votes
1answer
39 views

Using cut command for an environment variable

I want to extract the host name of a machine and omit whatever exists after .. For example, the command hostname says compute-0-0.local. So, I used `cut command like this # hostname | cut -f 1 -d "." ...
2
votes
2answers
40 views

Add environment variable for duration of Make task

I'm using make to handle building files for my application, and those build processes use node modules. Since I install those node modules locally, I have to specify in my $PATH where to call the ...
8
votes
3answers
12k views

how to pass environment variable to sudo su

I basically need to do this: DUMMY=dummy sudo su - ec2-user -c 'echo $DUMMY' This doesnt work. How can I pass the env variable $DUMMY to su? -p doesnt work with -l.
1
vote
3answers
37 views

Finding the file that contains the added path to $PATH

A command has been added to the $PATH, but I cannot find the place that the path has been added to $PATH. Please see that which shows the full path to the binary file, however looking into .bashrc, ....
1
vote
0answers
40 views

unable to set GOPATH, despite beign set! [closed]

Edited: I found the reason! all of this was caused by an inapprotriate use of the sudo command while making directories and installing the GoLang language from the git repository. By using the ...
0
votes
0answers
20 views

Set variables into script before or after SCP [duplicate]

I have two scripts out and disk_check.sh. The main script is the out which exports multiple variables but I need two variables set in disk_check.sh which are: VOL and VM_VOLUME. So my out script ...
0
votes
1answer
41 views

How do I pipe the output of a curl command to an environment variable and use it in another curl command?

I have a REST endpoint that I can get an access token from. To get the access token (JSON web token, JWT) and export that value as an environment variable, I do the following. export ACCESS_TOKEN=$(...
0
votes
1answer
29 views

HISTFILE env var unset within programs. Can I access it in any way? [duplicate]

When I try to access the "HISTFILE" env var within a program, it isn't there $ echo $HISTFILE /Users/drewgross/.bash_history $ python Python 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 ...
0
votes
1answer
3k 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 ...
0
votes
1answer
46 views

`source …/settings.csh` not working from `sh ./test.sh`

I want to source Xilinx ise setiin64.csh file with the source command. I have source /home/xilinx/ise_14.5/14.5/ISE_DS/settings64.csh in another file, test.sh. So I want to run only test.sh file ...
3
votes
3answers
818 views

Setting the TOPCOLORS environment variable

I don't seem to be able to find any examples on the Internet for this environment variable, which top will apparently read and use to display colours. How would I set this variable correctly so top ...
1
vote
0answers
50 views

why aren't environment variables being set no matter where I save them? (/etc/profile, /etc/bash.bashrc, etc) [closed]

I'm trying to set the display variable on an ec2 instance. I started by trying to put them in /etc/environment and did a re-login but nothing. Then I tried /etc/bash.bashrc, /etc/profile, and finally ...
0
votes
1answer
50 views

How to display all the environment variables stored in my unix?

Is there any command to display all the Environment variables stored in my unix?
14
votes
3answers
419 views

Replace environment variables in a file with their actual values?

Is there an easy way to substitute/evaluate environment variables in a file? Like let's say I have a file config.xml that contains: <property> <name>instanceId</name> <...
1
vote
2answers
33 views

How to start a new shell, pass it new environment variables, and work there until exit?

I need a special shell environment set up to interact with an commercial application that we have purchased. The environment is queried "on the fly" from the application. So I've attempted to start ...
0
votes
0answers
55 views

What are the minimum required environment variables? [migrated]

I am writing a shell. With the execvpe system call, I can run a program and control its environment. What are the minimum values I need to pass through here? Alternatively, I understand that child ...
0
votes
1answer
66 views

No manual entry for git

I'm able to use man git when MANPATH is set to the following: $ echo $MANPATH /usr/local/opt/findutils/libexec/gnuman:/usr/local/opt/coreutils/libexec/gnuman: However, when it doesn't include the ...
4
votes
2answers
110 views

Replacing only specific variables with envsubst

I'm trying to perform environment variable replacement through envsubst, but I want to only replace specific variables. From the docs I should be able to tell envsubst to only replace certain ...
1
vote
1answer
26 views

How can I make sudo discard all environment variables? [duplicate]

People usually want to preserve their environment variables while executing sudo for various reasons, but, there are some cases where discarding environment variables makes much more sense. For ...
1
vote
1answer
25 views

CentOS not starting after environment change

I created a CentOS machine using a Cloudera training vm with the help of VirtualBox. Then, because I want to use spark on the virtual machine, I installed the java 1.8 version following the exact ...
0
votes
1answer
58 views

Is `env` not to print out the environment in the current shell, but the environment received within `env`?

coreutils manual says about env command that env [option]... [name=value]... [command [args]...] If no command name is specified following the environment specifications, the resulting ...
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 ...
2
votes
1answer
37 views

Incorrect $HOME env variable for a newly created user

On my Ubuntu machine, I logged in as "olduser" and created "newuser" using the following command: adduser --system --home /usr/share/newuser --no-create-home --ingroup newgroup --disabled-password --...
0
votes
3answers
75 views

Usage of `_` as an environment variable passed to a command

From bash manual _ At shell startup, set to the absolute pathname used to invoke the shell or shell script being executed as passed in the environment or ...
0
votes
1answer
34 views

How to set multiple versions of Java on linux

I have Java 1.6 installed on my Linux box and all users and programs used it. Now, I need to install a program which uses version 1.7. I want to install this version such that everyone else continues ...
11
votes
2answers
34k views

How to alter PATH within a shell script?

I have several projects that require me to change versions of Java/Grails/Maven. I'm trying to handle this with some scripts that would make the changes. For example: #!/bin/sh export JAVA_HOME=/...
0
votes
1answer
58 views

login loop after editing /etc/profile and /etc/login.defs

I am relatively new to Linux/Unix and I have a Debian Jessie 8 distribution installed in my laptop. I tried to install tex-live following the instructions in this TeX.stackexchange.com post At some ...
5
votes
2answers
62 views

Making environment variables available for downstream processes started within an init.d script

This questions stems from @FrustratedWithFormsDesigner comment. How do I make export environment variables set within an init.d script available to downstream processes started within that same init....
4
votes
2answers
1k views

How to set environment variables under MATE?

I have just installed MATE under Ubuntu Saucy. No problems. Except I am trying to setup Texmaker, the LaTeX IDE, and cannot figure out how to set the paths to the LaTeX tools (pdflatex, etc.) which ...
0
votes
4answers
965 views

Unset http_proxy enviroment variable

Updated 11/03: After doing some test with your suggestions, I only can be sure about one thing: there is something related to the graphical environment, because if I login through ssh or using a ...
5
votes
5answers
21k views

Adding directory to PATH through Makefile

I'm having some trouble in exporting the PATH I've modified inside the Makefile into the current Terminal. I'm trying to add to the PATH, the bin folder inside wherever the Makefile directory is. ...
41
votes
5answers
20k views

How to run a program in a clean environment in bash?

I want to run a program in an empty environment (i.e. with no envariables set). How to do this in bash?
3
votes
1answer
67 views

set environment variables from stdout

How can you do the equivalent of piping stdout to 'export'? For background, I have a non-shell script that generates environment variables like so: DATABASE_URL='someurl' MAIL_KEY='key' REDIS_URL='...
4
votes
6answers
22k views

Removing a directory from PATH

I'm trying to compile wxWidgets using MingW, and I have cygwin in my path, which seems to conflict. So I would like to remove /d/Programme/cygwin/bin from the PATH variable and I wonder if there is ...
0
votes
0answers
13 views

What will be the result when USERGROUPS_ENAB is set to no in /etc/login.defs and no groupname is specified when using the commnd useradd

The default command when we add a user is: sudo adduser -m -g initial_group -G additional_group -s login_shell user_name In /etc/login.defs USERGROUPS_ENAB is set to yes by default This means ...
30
votes
3answers
50k views

Refresh env variables after editing bashrc file

I frequently edited the .bashrc file to export new environment variables. Rather than close the console and start a new one to refresh the env variables, is there a convenient way to refresh?
0
votes
2answers
2k 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" ...
1
vote
1answer
26 views

Ranger file manager - Open gnome-terminal instead of xterm

I recently started using Ranger as my default file manager, and I'm really enjoying it. Right now, I've managed to change rifle.conf so that when I play audio or video from Ranger, mpv opens in a new ...
44
votes
10answers
86k views

How can I run a cron command with existing environmental variables?

How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
13
votes
2answers
46k views

sudo as another user with their environment

$ whoami admin $ sudo -S -u otheruser whoami otheruser $ sudo -S -u otheruser /bin/bash -l -c 'echo $HOME' /home/admin Why isn't $HOME being set to /home/otheruser even though bash is invoked as a ...
67
votes
3answers
12k views

$VAR vs ${VAR} and to quote or not to quote

I can write VAR=$VAR1 VAR=${VAR1} VAR="$VAR1" VAR="${VAR1}" the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?
0
votes
1answer
77 views

/etc/environment: /root: Permission denied

Whenever I run apt install to install a package it fails. I get this output at the bottom. It seems to go fine until it asks for permission ([y/n]) then is immediately followed by this output, ...
2
votes
2answers
92 views

Use env with environment variables from file

Let's say I have a file (called e) with this content: a=3 b="5 6" How can I get each one to be interpreted as a separate argument to env? That is, to have it equivalent to: $ env a=3 b="5 6" ...