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

learn more… | top users | synonyms (1)

0
votes
2answers
54 views

export PATH permanently [duplicate]

I have exported the PATH but once I switch to a different terminal or reboot Debian, $PATH is reset. Here are the steps I take: ~$ vim scripts.sh #!/bin/bash echo "Hello" I save it as mybash.sh ...
4
votes
0answers
40 views

Is it possible to make an exec call that “returns”?

Is there a way to make the exec system call work like a function call that returns instead of totally replacing the current process image? My motivation is trying to integrate two shells with ...
2
votes
1answer
43 views

Why sudo env is not showing all the environment variables?

I have a variable set in a script file in /etc/profile.d/somescript.sh I have modified the /etc/sudoers and added "ansible" user to the sudoers file like this: Defaults !env_reset ansible ...
1
vote
0answers
52 views

How to set Ruby GEM_HOME and GEM_PATH

I'm a NOVICE user of Linux and using Linux mint 17.1 I've reinstalled Linux mint 20 time in last 3 days for that issue but could not fix it I'm trying to install ruby on rails using rvm what ...
2
votes
1answer
44 views

How do I run GUI applications as root by using pkexec?

I am using Trisquel GNU/Linux-Libre which comes with Gnome3 Flashback Desktop Environment. I know that I can run GUI application as root by sudo & gksudo but I want to know that How do I run GUI ...
-1
votes
1answer
23 views

How can I execute and export in a single shellscript

I have two shell scripts. $ cat java_alternative_7 #!/bin/sh sudo update-java-alternatives -s java-7-oracle $ cat java_home_7 #!/bin/sh export JAVA_HOME=/usr/lib/jvm/java-7-oracle It's simple that ...
0
votes
0answers
5 views

Pip managed python extending distribution packaged modules

I am looking for recommendations on extending the python library managed by my arbitrary distribution with packages available via PPI. Basically I have been working with a distro managed installation ...
1
vote
1answer
14 views

When not started from a terminal, Emacs does NOT pick up the SSH_AUTH_SOCK environment variable

When I don't start it from a terminal, Emacs 24.5.1 (compiled from source) doesn't pick up my environment variables. In particular, to "import" the environment variables from shell, I have in my ...
2
votes
2answers
56 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
51 views

Differences between sudo and su in inheriting environment

Why can the command run by sudo inherit the environment from the parent shell process, while the shell process after sudo su to the root user doesn't? t@ocean:/tmp$ export ME=tim t@ocean:/tmp$ sudo ...
1
vote
2answers
48 views

Identify user defined variables

In a GNU/Linux bash shell, I am using a command to identify and save all my user defined variables at a specific point in time for debugging purposes (I source the file later): declare | grep ...
0
votes
3answers
53 views

Pass environment variables' values to a program? [duplicate]

When I run a perl script pdfannotextractor.pl in bash, I want to set the value of a variable TEXMFVAR needed by the script, and pass it to the script. I googled around, and thought I found a ...
0
votes
1answer
30 views

csh: Terminal inherits environment variables from an unknown location

I'm on a shared machine running CentOS 5.10 that I log onto using VNC from Windows 7. Our default and official shell is csh. Every time I open a new terminal, I have three particular environment ...
2
votes
2answers
60 views

Weird behaviour when setting environment variables with .bash_profile: only last export works properly

I am trying to export some environment variables in Unix using the .bash_profile It reads now like this: export PATH=${PATH}:/usr/local/cuda-6.0/bin/ export ...
0
votes
1answer
56 views

Strange output when echoing variable from a different user

$ sudo su - user1 -c 'echo $DOMAIN_HOME' /app/user1/DOMAINHOME This looks fine, right? However, let's dig a little deeper: $ sudo su - user1 -c 'echo $DOMAIN_HOME' | tee test.out $less test.out ...
0
votes
2answers
45 views

set library path for current script [closed]

How can I set the library path for the current script that's running? I mean I don't want to list a new path for the libraries in a textfile. I tried it using export LD_LIBRARY_PATH=$(pwd)/lib/ This ...
2
votes
2answers
104 views

Where does the TERM environment variable default get set?

When I open a terminal window with the GNOME Terminal emulator in the desktop GUI the shell TERM environment variable defaults to the value xterm. If I use CTL+ALT+F1 to switch to a console TTY ...
-1
votes
1answer
28 views

How do I set an environment variable in the shell to be result of python script? [duplicate]

If I run export TEST=script.py echo $TEST It outputs script.py script.py code: return 5 can TEST be set to 5? Obviously script will do something in future not just return a number
0
votes
1answer
25 views

How can I add default command line parameters to an executable in a way that will also work on GUI apps? [duplicate]

I want to pass a command line program by default when I run it. myprog --foo=bar The solution I could think of was to add a custom "myprog" wrapper to my "bin" folder #! /bin/sh /usr/bin/myprog ...
18
votes
1answer
297 views

Why does exporting vim as EDITOR in zsh disable keyboard shortcuts?

My .zshrc looks like this: export EDITOR="/usr/bin/vim" Now when I open a terminal and enter a keyboard shortcut like ctrla to go to the beginning of the line, it doesn't work. Instead, the string ...
3
votes
1answer
43 views

Bash Environment Variable Issue [closed]

We have a 3rd party scheduler that runs one of our job's shell scripts in bash. When the shell script is called, it sets the environment variables from the scheduler as $1, $2, $3, etc on the command ...
3
votes
1answer
53 views

Run a command in background that sets env var or define function

> export foo=1 & [1] 9016 [1] + done export foo=1 > echo $foo > I know when running a command with & you spawn a new process and the export foo=1 is not setting env vars in ...
1
vote
1answer
28 views

Setting environment vars containing space with env

I'm trying to use env to set environment variables (read from another source, say for example a file) for a subprocess. Essentially, I am attempting the following: env VALUE=thisisatest ...
3
votes
3answers
167 views

Environment variables. Where are they saved in? [duplicate]

If I do not edit the .bashrc or other config files, the environment variables that I've setted are gone when I logout, or turn off the terminal. What I'm curious is, where are those 'temporary' env ...
0
votes
0answers
20 views

Why does not changing changing LC_ALL from utf to C speed up my grep?

I wanted to try to speed up my already fast grep. I read that changing lc_all from utf to c was supposed to do this. However, it gives no speedup. What might the reasons be? How do I "debug" this? ...
11
votes
2answers
826 views

What is DISPLAY=:0?

What is DISPLAY=:0 and what does it mean? It isn't a command, is it? (gnome-panel is a command.) DISPLAY=:0 gnome-panel
3
votes
1answer
44 views

Question on environmental variable

I have Oracle jdk7 installed on my centos6. I noticed that the /etc/profile has the lines below: #below lines are added for Java export JAVA_HOME="/usr/java/latest" ## export JAVA_HOME JDK ## export ...
0
votes
2answers
54 views

What is the variable of $#?

I'm learning introductory Linux and came across something which I did not understand: "The following command has been executed: set 10 20 30 40 50 Enter the value of the variable $#: I understand ...
0
votes
1answer
21 views

Linux environment variable using non-fullpath

I'm setting the environment variable LD_PRELOAD to a shared library file I created, in order to let LD_PRELOAD to point to my created shared library file, I need to give the full path like this: ...
1
vote
1answer
39 views

Loading .profile from .bash_profile or not using bash_profile at all? [duplicate]

I am on a MAC running Yosemite. Until recently, I only had a .profile, in which I added directories to my PATH. Now I have a .bash_profile, which from what I experienced and later read online, ...
3
votes
3answers
56 views

Is there a nice way to set directory/project local environment variables?

I have been working on several projects, and they require different environment variables (e.g., PATH for different versions of clang executables, PYTHONPATH for several external modules). Whenever I ...
1
vote
1answer
51 views

Optimal way to set and read variables

I need to set 6 variables which are used by several services and applications in Linux. I have so far been using the environment variables, but find it very complicating to modify these variables ...
0
votes
1answer
31 views

Exporting a piped command without evaluating output?

I'm trying to set an export that would effectively kill a process based on the PID that pgrep feeds it. Running the command kill $(pgrep myAppName) appears to work (if 'myAppName' were the name of an ...
0
votes
0answers
138 views

How do I get Ubuntu to use Anaconda's python instead of the standard /usr/lib/python…?

I installed Anaconda using instructions provided on the main website, which are similar to those that can be seen here: http://askubuntu.com/questions/505919/installing-anaconda-python-on-ubuntu ...
0
votes
2answers
62 views

Why doesn't `sudo su -l -c “java”` work even though `sudo su -l -c “echo $PATH”` displays the location of the java binary? [duplicate]

I have a server with Java binaries from a tarball on a custom location, and the following in /etc/bash.bashrc: export JAVA_HOME=/path/to/java/home export PATH=$JAVA_HOME/bin:$PATH When I run sudo ...
0
votes
1answer
26 views

Why doesn't commons-daemon ./configure recognize $JAVA_HOME? [closed]

I'm trying to install a tomcat 7 server. I'm following these instructions from the tomcat 7 docs. I also set my JAVA_HOME variable in ~/bashrc as well as ~/.bash_profile and /etc/profile. I can do ...
1
vote
4answers
134 views

bash division of numbers in text file

I have two numbers in test.txt file, I would like a way to divide the second number by the first number and assign the result to a variable or file in a bash script that I can use. I have used awk ...
1
vote
1answer
76 views

Environment Variables not getting set in bash_profile

I have my bash_profile environment setting as follows: if [ `hostname` = "devoraebs01" ]; then echo `hostname -f` . /appl_top/deverp/appl/APPSDEVERP_devoraebs01.env When I log into this host, ...
2
votes
2answers
59 views

Is shell parent of all the processes in linux

I have been trying to understand shell scopes and environment in depth. I have been reading about how if we do export VARIABLE=VALUE it will be available in subshell. So I wanted to ask a question I ...
1
vote
2answers
28 views

tcsh: make 2-digit hours in prompt

I am attempting to simply get a standard lexigraphical time display in the prompt and the history file in the range of 00:00:00 to 23:59:59. I've tried set prompt=%P$ but this just produces, for ...
2
votes
1answer
36 views

Running a constructed command from bash script

I constructed a command like this in a bash script a="my_cmd"; a="$a --verbose"; echo $a; $a; It works and executes my command correctly. But when I add an environment variable to the mix it ...
1
vote
1answer
40 views

When did bash quit exporting SHELL?

I upgraded a Debian box from stable to Jessie and I noticed that SHELL is no longer exported, so screen and similar programs start dash for subshells instead of bash. When was this change made and ...
1
vote
1answer
73 views

su or sudo keeping/removing certain environment variables

I would like to be able to log in as another user and keep most, but not all of my environment. Specifically, I would like to set $HOME to the correct value for the new user, but keep probably ...
1
vote
2answers
30 views

Does X mangle prompt environment variables?

I'm starting it with startx. Before that I have PS1 in my environment: $ cat /proc/self/environ | tr '\0' '\n' | egrep '^PS' PS1=[\u@\H \w] PS3=> PS2=> PS4=+ From inside X I get: $ cat ...
1
vote
1answer
34 views

How can I consistently set an environment variable for a single program?

I'm using LC_TIME="en_AU.UTF-8" in general, and I'm happy with that. However, when I use Thunderbird, I'd like it to use a 12-hour clock. I've created a custom locale, and it works fine if I launch ...
0
votes
0answers
87 views

Possible to pass env vars into chpst without envdir?

I use runit to daemonize my web application, and I'm trying to see if I can have my process managed by sv not have to have a corresponding envdir for its environment variables. I wonder if I can just ...
1
vote
0answers
41 views

What does CRON=1 do?

What does setting CRON=1 do when set in front of a command? CRON=1 ./foobar.sh I suspect that the cron environment variable does something for printing to standard out. But I can't find anything ...
2
votes
3answers
72 views

Controlling the environ passed to child process by bash

I am using x86_64 GNU/Linux with bash #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { system("set > setc"); // A subset of `$ ...
2
votes
0answers
23 views

Configure where GRUB2 environment block is located

I have Arch, Ubuntu, and GRUB2 installed on a BTRFS filesystem. I'm aware that GRUB cannot write to BTRFS for a variety of good reasons, and therefore cannot save environment variables to ...
1
vote
0answers
40 views

How to set environment variable for BACI compiler and interpreter?

I have installed executable files for BACI compiler and interpreter in my Ubuntu system. But now every time I have to compile my .cm file I have to go to the program folder and run ./bacc and ...