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

learn more… | top users | synonyms (1)

1
vote
1answer
27 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 ...
0
votes
0answers
30 views

JCE provider usable as root but not regular user

I am trying to install the nCipher JCE provider and have done the following - Copied the nCipherKM.jar file to $JAVA_HOME/jre/lib/ext Updated $JAVA_HOME/jre/lib/security/java.security with the line ...
6
votes
2answers
380 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 $ ...
1
vote
1answer
36 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 ....
0
votes
1answer
40 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 "." ...
13
votes
4answers
711 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 ...
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 ...
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 ...
1
vote
3answers
39 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, ....
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
43 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
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 ...
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?
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 ...
14
votes
3answers
430 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
34 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 ...
4
votes
2answers
117 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 ...
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
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 ...
0
votes
3answers
76 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 ...
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
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 ...
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 ...
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='...
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 ...
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 ...
0
votes
1answer
80 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, ...
0
votes
1answer
41 views

How to save an alias of an eval $(other_comand) command

I've been using docker for a while and there's a command I write each time I boot up my docker: eval $(docker-machine env) I know eval shouldn't be used unless necessary, but it's mentioned by the ...
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" ...
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....
1
vote
2answers
32 views

bash : export: `PATH:home/pi/netkit/bin:/usr/local … invalid indentifier [duplicate]

Currently I'm struggling with some notification every time I open terminal: bash: export: `PATH:home/pi/netkit/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:bin:/usr/local/games/:/usr/...
1
vote
1answer
27 views

What is ${PYTHON_REL} FreeBSD

I have an error whilst making a port, so I checked the makefile, and found the problematic line. The issue is that I don't know how to fix it, as I don't know how to change the Python_Rel variable. ...
5
votes
3answers
496 views

Exclamation mark variable `$!`

I have been studying for my Unix exam and I often saw exclamation mark variable - $! If I write echo $! on my Mac shell tells me something like "You have mail in…" Is purpose of this to store whether ...
1
vote
1answer
24 views

saving path on Debian

I add this to the end of ~/.profile PATH=/usr/local/texlive/2015/bin/x86_64-linux:$PATH export PATH but it is never saved. Close the terminal, open it again and the path is without the one to latex....
1
vote
2answers
53 views

Setting path environment variable for desktop launchers [duplicate]

I set a custom $PATH in ~/.bashrc with PATH=$HOME/.bin:$PATH. When I launch the geany from the terminal it is able to find my custom build tools that are located in $HOME/.bin. When I launch Geany ...
2
votes
1answer
44 views

Can I use an environment variable to define an alias?

I'm using an automation engine to run perl scripts. script_X requires a wrapper script so it's run like: wrapper_script script_X --parameters But the automation engine can't understand that ...
1
vote
1answer
36 views

timestamping history file causing erroneous lines in history command

I have .bash_profile setup to export to a history file: export HISTFILE=/root/history/.bash_hist-$(who -m | awk '{print $1}') Then I am exporting time stamps for the history command. export ...
1
vote
1answer
63 views

export (save) and import (source) shell variables

I need to save environment variables to a file and (later) a process should import them. I need this to workaround a program fooprog that nullifies the environment before executing a barscript, and I ...
-1
votes
1answer
94 views

Where do C# executables running on an Ubuntu Linux 16.04 desktop which use source code that DLLImport's shared objects look for them at runtime? [closed]

Where do C# executables running on an Ubuntu Linux 16.04 Lenovo Thinkstation desktop which use source code that DLLImport's shared objects (so's) look for shared objects at runtime? Even if the shared ...
0
votes
1answer
38 views

Is using env and export the same thing?

I'm wondering whether this (From https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps): env VAR1="blahblah" command_to_run ...
1
vote
0answers
29 views

no names in kali linux [closed]

I am running kali linux, which has gnome. I just updated with: apt-get update && apt-get upgrade that what happen apt-get update && apt-get upgrade
3
votes
2answers
77 views

How to export a variable from a perl script into a shell script?

I have a shell script in which I am running perl script by below code. perl perlscript.pl In the perl script I have defined a variable called $circle. Now I want to use this variable value in my ...
4
votes
2answers
372 views

SH: How to make vars from one script available in the main script?

I have two scripts that need to run and both require the same variables set the same way. As a result I figured I'd break the setting of the variables out into a separate script. However, I can't seem ...
4
votes
3answers
515 views

Is there a Unix equivalent of the Windows environment variable PATHEXT

I am wondering if there is a Unix equivalent for the Windows environment variable PATHEXT. For those with no Windows background: Adding a file suffix to PATHEXT allows me to execute a script without ...
1
vote
1answer
67 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 &...