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

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

Is there a plugin or tool for multiple “profiles” in ZSH?

I use oh-my-zsh for all of my console goodness. Depending on what I'm working on, there are certain environment variables that I'm often overwriting either manually or through scripts to make my work ...
0
votes
0answers
15 views

custom init.d script works using sh -x <script> stop but fails when called directly or with service.. why?

I have a custom service and wrote a simple init.d script, serverE. (pasted below) All the service does is start up on a defined port and listen for connections. The problem is when I run either "...
0
votes
1answer
22 views

/etc/login.defs: ENV_PATH & ENV_SUPATH vs PATH

In /etc/login.defs what are ENV_PATH and ENV_SUPATH used for? From /etc/login.defs: # REQUIRED The default PATH settings, for superuser and normal users. # # (they are minimal, add the ...
4
votes
0answers
38 views

Set environment variables for gnome on wayland and bash on virtual terminals (or ssh)

Gnome 3.22 uses wayland by default. Gnome on wayland does not read ~/.profile (or ~/.bash_profile or /etc/profile). See https://bugzilla.gnome.org/show_bug.cgi?id=736660. I have my initialization ...
0
votes
0answers
24 views

Env Variable different from user to root

I'm tryng to correcly install qutip, but python is giving me a very hard time. I have kubuntu. I have installed python 2.7.12, with kubuntu there already was python 3 but this is not giving me ...
0
votes
0answers
9 views

how might it be possible to have different environment variables, depending on which directory my ssh client is in? [duplicate]

A colleague told me that he'd heard this was possible. How can I have different environment variables, based upon the current directory that my ssh client is in? For example, if I am in in /home/...
1
vote
1answer
22 views

setenv path precedence

I'v got to include the path of a same software but two different version installed in two different location, since I have no edit permission of these file and there are some other softwares in these ...
0
votes
2answers
18 views

How to ask systemd service to reload its environment variables on runtime

Question My C++ application runs as a systemd service. I need to configure it using environment variables, and be able to reload the value of the variables during runtime without restarting the ...
0
votes
0answers
16 views

Use Environment Variables of User in Target Server during SSH

I am trying to write a script in server1 which will be executed using user1 to execute some commands in server2 with user2 So in server1 if I try to execute the below command using user1, I am not ...
-2
votes
0answers
18 views

export command question [duplicate]

I am trying to install/run mdtest and the instructions says that I need to add some paths to the env. however I run the command suggested: export MDTEST_FLAGS=-D_HAS_S3 -I/usr/include/libxml2 -I/...
1
vote
1answer
72 views

Setting up environment variables with .sh file [duplicate]

I have created env.sh file the contents of which are below #!/bin/sh export M2_HOME=/vagrant/tools/maven export PATH=$PATH:$M2_HOME/bin export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65 export ANT_HOME=/usr/...
0
votes
2answers
18 views

Setting my variable, do I use the dot notation or ~?

All my Hadoop configuration files are located in the following: ./.linuxbrew/Cellar/hadoop/2.7.3/libexec/etc/hadoop/" To set my HADOOP_HOME variable, do I use the dot notation or ~? HADOOP_HOME = "....
-1
votes
1answer
11 views

View local variables on CentOS

How can I view local variables? If I create a local variable e.g. VR1=rhe17 I'm not able to see it when running printenv unless I make it an environment variable using export VR1.
2
votes
2answers
26 views

permanently setting vim as the $EDITOR for crontab

I am trying to tell my terminal to use vim instead of vi when editing crontab by executing export EDITOR=vim. But closing the terminal and opening a new one just resets the session. How do I change ...
0
votes
2answers
31 views

Change directory of command

I have two versions of PHP: macabeus@macabeus-acer ~ $ whereis php php: /usr/bin/php /usr/bin/X11/php /usr/share/php /opt/php-my-version-7.0/bin/php /usr/share/man/man1/php.1.gz macabeus@macabeus-...
0
votes
1answer
23 views

admin vs. sudo user: program not working for user (sudo env problem?)

I'm working on a QNAP NAS-system (which alone is troublesome; firmware: 4.1.1 (not that new)) and installed duplicity through some community-package. Problem Logged in as admin (which is the ...
0
votes
2answers
64 views

How to set SHELL=/bin/bash globally for cron

With BASH_ENV assigned in /etc/environment I noticed that it doesn't affect cron jobs. I figured out that having SHELL=/bin/bash in a users' crontab does the trick! Yes! If I simply add (to the ...
3
votes
2answers
88 views

How to store / load exported environment variables to / from a file

I would like to be able to save my current environment in a file (for a running interactive session), so that I can: Save it, export/modify/delete variables at will in the running session, then ...
1
vote
1answer
91 views

How can I set environment variables for a program executed using `nohup`?

(I'm editing an existing Bash script, so I'm probably making a silly mistake here...) I have a shell script that saves a command with an environment variable as its argument like this: COMMAND="mvn ...
0
votes
3answers
65 views

Is gnome terminal is a type of non login shell?

According to the answer of the question, http://askubuntu.com/questions/155865/what-are-login-and-non-login-shells, gnome terminal is a type of non-login shell. As pointed out in the excellent book, A ...
3
votes
2answers
43 views

IFS variable ignored in system()

For a class at my university I am trying to achieve a privilege escalation. I have this simple code that simply replicates the output of ls and has SUID bit set. int main(void){ system("/bin/ls"); ...
1
vote
2answers
52 views

Sudo - target user environment

Is there a way (without jumping through too many hoops) to run sudo -uuser command in such a way that user's environment is entirely preserved? Basically, what I need is to ensure that specific ...
1
vote
2answers
40 views

change location of .sqlite_history file

sqlite3 stores command history in .sqlite_history, which is by default created in: $HOME/.sqlite_history How can I change this location to somewhere else? This is possible for example with mysql, ...
1
vote
0answers
63 views

Properly installing GMP, MPFR, MPC and GCC

Im trying to install the LibND4J library, which requires GCC 4.9 or above. I'm using a Linux Mint 17 (Rebecca). To install GCC, I downloaded the 6.2.0 tar from the website and I extracted and ./...
1
vote
0answers
49 views

Master environment script based on $LOGNAME to run on any shell invocation

Dealing with a nice list of Linux (and Solaris) servers, I find that 90% of my users need the same environment variables with a few specifics unique for an individual user. My goal is to eliminate ...
2
votes
1answer
42 views

Why do bash variable assignments affect the last exit code $? and where is this documented?

I was surprised to find out that setting an environment variable modified the last exist code variable $?: $ false $ echo $? 1 $ false $ FOO=BAR $ echo $? 0 $ The bash manual says only this about $?...
2
votes
2answers
50 views

Convention personal environment variables

Is there an Unix convention for setting personal environment variables? I read they should be put in $HOME/.bash_profile instead of $HOME/.bashrc. Nonetheless, I was thinking of providing a way to ...
4
votes
1answer
117 views

Why doesn't unsetenv() modify /proc/pid/environ?

I was just looking at this question and wrote a noddy program to demonstrate unsetenv() modifying /proc/pid/environ. To my surprise it has no effect! Here's what I did: #include <stdio.h> #...
4
votes
1answer
205 views

change /proc/PID/environ after process start

$ k=v p & [1] 3028 is there any way for p to change the contents of /proc/3028/environ to not mention k=v while p is still running?
1
vote
2answers
133 views

Working with local and remote variables in ssh session

I'm writing a script that should scp me some files after they have been processed on a remote server. To do that I need variables from the local server that executes the script and later some ...
0
votes
0answers
14 views

Automatically export PATH for Google App Engine django library

Is there a way to automatically run the following command when I open up a new terminal? export PYTHONPATH="$PYTHONPATH:/home/user/google_appengine:/home/user/google_appegine/lib/django-1.9" I tried ...
2
votes
1answer
61 views

where is the PATH for users set in linux, before any shell, or sudo, pam.d changes it?

I noticed that in Raspbian that if I run a command via ssh without using a shell, I get the following $PATH; $ ssh pi@raspberrypi env | grep PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/games I can't ...
1
vote
1answer
254 views

.bashrc doesn't export the path?

Every time I login to our company cluster, I first get a Kerberos ticket and then try to submit a job, but it fails to find spark-ubmit: -bash-4.1$ ./pipeline.runtime/scripts/vpspark-submit.sh crow-...
2
votes
0answers
77 views

Exported bash functions sometimes visible from Perl

My Redhat 9, OpenBSD 4.9, FreeBSD 10, Macos X, LinuxMint 17.3, and Ubuntu 14.04.4 all print OK when running this: myfunc() { echo OK; } export -f myfunc perl -e open\(\$fh,\"\|-\",\"@ARGV\"\)\;close\$...
0
votes
2answers
259 views

Setting variables in /etc/environment not having an affect but setting them in command line is [duplicate]

I am setting certain environment variables for the command pyspark to work. When I set the variables in /etc/environment and source it, it doesn't work. However, when I set them in command line they ...
0
votes
1answer
60 views

How to recover a clobbered LD_LIBRARY_PATH on Ubuntu Linux 16.04?

I would like to find out how to recover a clobbered LD_LIBRARY_PATH on Ubuntu Linux 16.04. I clobbbered it a few days ago by setting the global environment variable LD_LIBRARY_PATH to /home/frankc/...
1
vote
1answer
101 views

Why can't I add something to PATH permanently? [duplicate]

I am trying to add ruby binaries to my path with this : $ PATH=$PATH:/home/ehsan/.gem/ruby/2.3.0/bin This works fine in that terminal session and I get : $ rails -v Rails 5.0.0 But after I close ...
1
vote
1answer
34 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
398 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
161 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
22 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
129 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 "." ...
14
votes
4answers
797 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
53 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
21 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
71 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
40 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
125 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
80 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
63 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?