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

learn more… | top users | synonyms (1)

0
votes
1answer
36 views

How do I store bash env vars in array then access/modify?

I want to store environment variables in a bash array, and then use them in cases where I perform the same operation on all of them (unset, export an so on). For example, if I want to print all env ...
1
vote
0answers
27 views

Arch Linux with Mate ignores exports in ~/.bash_profile and ~/.profile

I use Arch Linux and need to add environment variables on login. I have Plasma, Cinnamon and Mate installed. For some reason the environment variables in ~/.profile and ~/.bash_profile are not set ...
3
votes
3answers
44 views

get Cron to run in the same environment as I get with ssh login

I've a script that runs fine when I ssh to my ubuntu EC2 instance and run it (as the user ubuntu) I want this to happen when the server boots, so I added it to cron as: @reboot sleep 10 && /...
2
votes
1answer
31 views

Recommended Way To Associate Command With Environment?

Sometimes I find myself using software (which I don't have the permissions or patience to re-compile) which searches through my PATH looking for its dependencies at runtime, but these dependencies are ...
1
vote
1answer
42 views

Set environment variable for all services running under systemd

I am currently working on a deployment tool that will be configuring environment variables across CentOS7 machines. As it stands, my tool is aware of what variables need to be configured, but is not ...
0
votes
1answer
40 views

Check if Environment Variable exists for an user with su

I'm on it since days, I need to check for an user $1 if an Environnement Variable $2 exists. I tried some cases : $ [[ -v a ]] && echo "a ok" || echo "a no" a no $ [[ -v $HOME ]] &&...
0
votes
1answer
25 views

su -l root -c “echo $HOME” prints my user home

this is my first post, I've some questions about su - [user] -c [command] I've made some searches, I found this thread and this other one who are related to my question. I'm trying to set an ...
0
votes
1answer
34 views

Can't use latest youtube-dl outside the install folder

I recently installed youtube-dl from github: https://github.com/rg3/youtube-dl It works if I run it inside the install folder, like this: $ cd /home/max/software/youtube-dl $ bin/youtube-dl <url&...
0
votes
0answers
13 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
22 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
47 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
83 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
32 views

Env Variable different from user to root

I'm trying to correctly 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
10 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
27 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
28 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
19 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 ...
1
vote
1answer
91 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
13 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
29 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
32 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
24 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
103 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
103 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
168 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
84 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
52 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
70 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 ...
2
votes
2answers
50 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
99 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
52 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
46 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
63 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
125 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
239 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
230 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
15 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
70 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
349 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
84 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
407 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
81 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
108 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
38 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
404 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
203 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
35 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
163 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
822 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 ...