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

learn more… | top users | synonyms

0
votes
2answers
44 views

Percent signs and environment variable in a shell script

While troubleshooting an issue, I came across these entries given below in one of the shell scripts used by our application. This was written by someone who no longer works in the company and I am ...
1
vote
2answers
39 views

where is LD_LIBRARY_PATH? how do I set the LD_LIBRARY_PATH env variable?

where is LD_LIBRARY_PATH? how do I set the LD_LIBRARY_PATH env variable?
1
vote
1answer
23 views

Run an X11 program under Cygwin

How do I set the appropriate DISPLAY environment variable? I try to launch idle in cygwin using the following command: idle ...and I get a display error: _tkinter.TclError: no display name and ...
2
votes
1answer
33 views

Preserve environment variables using systemd?

Do systemd unit files support preserving existing environment variables? (Something similar to sudo -E?) Not referring to Environment= or EnvironmentFile= here. It would be be useful if systemd ...
2
votes
4answers
58 views

Change prompt when starting a terminal from bash script (but don't affect all terminals)

I have two terminals installed, gnome-terminal and xfce4-terminal. I would like to have only the xfce terminal showing a simple > as prompt when I start it. The gnome-terminal prompt should remain ...
0
votes
0answers
11 views

Loading linux environment variables [duplicate]

I have a set of environment variables and i would like to load it automatically on each startup. As of now i am doing the following: In /etc/environment export FLEETCTL_TUNNEL=10.77.189.179 In ...
1
vote
3answers
56 views

How Long do the Contents of the .bash_history File Last?

How can I modify the contents of my bash_history file? What values or variables control how long the history lasts? Are there any other things I can change to provide finer control of my BASH ...
1
vote
1answer
24 views

several virtual profiles for the same user

Many times there are several "identities" which one user uses: for work, open-source, academia etc., all require different ssh keys, editor configurations, git configs etc. I was wondering if there ...
2
votes
2answers
202 views

Meaning of \ before environment variable

In ksh on an old Solaris box I used: export PS1="$PWD $" to set the prompt to the current directory. It works great until you cd elsewhere, then you see that it's not evaluating PWD each time. I ...
1
vote
2answers
53 views

how to use http proxy in terminal

I have to use a http proxy to access Internet. Now I'm using firefox with the http proxy to access Internet. But on terminal, I can' access Internet. So are there ways to use http proxy on terminal ...
1
vote
1answer
100 views

Why is variable assignment preceding command ignored? [duplicate]

The bash 4.1 manpage states (emphasis added)... Simple Commands A simple command is a sequence of optional variable assignments followed by blank-separated words and redirections, and ...
4
votes
4answers
66 views

How to run a script as if it's running at boot?

I have a script running at boot time, however it's giving me errors I see in the log file. When I run it manually, it runs fine - probably the environment is changed. Is there a way to run such a ...
1
vote
0answers
56 views

export -f in .bashrc after upgrade to bash 4.3.30 kills builtins?

I recently upgraded my bash (Mac OS X 10.6.8) from 3.2.48(1) to 4.3.30(1) via macports, and while the install seems to have gone smoothly, the two spots in my ~/.bashrc where I had export -f myfunc; ...
2
votes
1answer
168 views

How to pass environment variables to a non-interactive shell (with example)?

In a sh script another sh script is started with su -l <user> -c /path/to/script.sh. As far as I understood script.sh will be run in a non-interactive shell. The official documentation tries to ...
7
votes
1answer
211 views

Why does bash even parse/run stuff put in the environment variable?

The shellshock bug in bash works by way of environment variables. Honestly I was suprised by the fact that there is such a feature like: "passing on of function definitions via env vars" Therefore ...
8
votes
2answers
159 views

Why is the ability to definine functions in an enviromental variable not a security risk in itself?

As I understand it, generally it is considered safe to let anyone provide information that will be stored in an environmental variable. The shellshock vulnerability is an issue here because it means ...
0
votes
0answers
22 views

Can't set PATH with a script [duplicate]

I have written a script which was supposed to add some value to environmental variable PATH, but script doesn't do that if I start it with ./script.sh. #! /bin/bash INSTALLDIR="/opt/ARM" ...
0
votes
1answer
54 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
41 views

How to set `screen` environment variable from bash?

Background I use virtualenv to switch between environments "1.0" and "2.0". I use screen to manage terminals. When I work on one environment I want all new screen windows to start with this ...
2
votes
1answer
78 views

Export multiple options in $GREP_OPTIONS

I use ZSH with "OH MY ZSH". In "OH MY ZSH" variable $GREP_OPTIONS exports with multiple value: $ echo $GREP_OPTIONS --color=auto --exclude-dir=.cvs --exclude-dir=.git --exclude-dir=.hg ...
2
votes
2answers
107 views

Using gdb to inspect environment variables

I have been trying to find the address of the SHELL environment variable in a program on a Ubuntu 12.04 machine. I have turned off ASLR. I found similar posts : SO question and blog post I have ...
0
votes
0answers
95 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
80 views

Trying to access environment variable (array) declared in ~/.profile from shell script

I'm currently fighting with this problem. I've already read some older posts here on SE, and got the conclusion that the only sane way to put a variable (even an array) is ~/.profile. So OK, array ...
1
vote
0answers
46 views

Setting XDG_DATA_HOME and XDG_CONFIG_HOME on compile/per program

The goal is to have a -dev version and a stable repository-based version installed at the same time, but with different data and config directories so that the dev version is not operating on(and ...
3
votes
0answers
214 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 ...
9
votes
1answer
216 views

Why does the location of Enviroment Variables vary that much?

Reading the book Hacking: The Art of Exploitation by Jon Erickson, I am trying to approximate the address of an environment variable SHELLCODE to exploit a program. Every time I run ...
2
votes
1answer
276 views

Which file defines the LESSOPEN environment variable?

please advise me about the following. On my Linux machine - I do the following: $ env | grep -i LESSOPEN LESSOPEN=|/usr/bin/lesspipe.sh %s So from env command I see that: ...
2
votes
2answers
243 views

How to find where is $JAVA_HOME set? [duplicate]

I'm a beginner with linux. I'm trying to change the value of $JAVA_HOME & I just can't seem to find in which file is it being set currently. I can't remember where did I set it the last time. ...
1
vote
1answer
79 views

Choice of editor when running under sudo

On an Ubuntu 12.04 machine I've used the alternatives system to set the editor to vim.basic. I get the correct editor when root but not when I sudo to root and run crontab, and I'm trying to ...
1
vote
1answer
40 views

Global variable for every script

I want to declare a variable in such way that every script can access and alter its value. I have written a script that set the value of a variable called flag on exit and I am using a crontab entry ...
1
vote
4answers
171 views

why do we not need export here?

$ IFS=";" $ read first second i am;a_i b c $ echo $first i am $ echo $second a_i b c $ echo $IFS Am I right that read first second is a subprocess of the current shell process? If yes, why don't ...
6
votes
2answers
159 views

Are environment variables visible to unprivileged users on Linux?

I'm trying to determine if, in Linux, environment variables for a process are observable by other (non-root) users. The immediate use case is putting secrets into environment variables. This is ...
1
vote
2answers
66 views

profile.d on headless server

Is it a bad idea to put variables needed by a daemon program running at boot on a headless system in /etc/profile.d/? From my understanding profile.d doesn't get executed until someone logs into the ...
7
votes
1answer
339 views

Echo difference between Ubuntu and Red Hat [closed]

I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying environment variables. In Ubuntu I ...
1
vote
1answer
304 views

Where can I set global Java Options?

I have horrible, improperly-rendered fonts in Java programs such as jabref and rubymine. This can be fixed by running _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' jabref I understand that I ...
0
votes
1answer
84 views

How set glib environment variable: g_slice

I've been told I need to set the following environment variable in order to work around a glib bug: G_SLICE=always-malloc But I don't know how to do it, and anywhere I've seen it's use recommended, ...
2
votes
2answers
468 views

How is PATH set for users in puppet?

I'm having an interesting problem which I was able to work around by manually specifying PATH. The problem is that although my root user's PATH is: ...
1
vote
0answers
359 views

Inherit environment variables in systemd Docker container

I have a Docker container running systemd. I want to pass environment variables to applications under it. When I start systemd from within Docker (/sbin/init as command line), Docker exposes ...
20
votes
2answers
868 views

Does ~ always equal $HOME

I know this has probably been asked before, but I couldn't find it with Google. Given Linux Kernel No configurations that change $HOME bash Will ~ == $HOME be true?
5
votes
3answers
239 views

Run program with environment set to variables in a file

I would like to run a program (in this case Python) with only the environment variables defined in a file, say vars.env: FOO=bar X=12 Here's a simply Python script that prints the environment: ...
4
votes
1answer
179 views

Keep getting the same result after “export PATH”

I am doing this: $ which cabal /usr/bin/cabal $ export PATH=$PATH:$HOME/.cabal/bin $ which cabal /usr/bin/cabal I expect to get /.cabal/bin/cabal for $ which cabal (this path exists) after this. ...
2
votes
1answer
99 views

How can I find where LANG, LANGUAGE and MAIL environmental variables are set?

I've had a few issues with environmental variables not set correctly in my Raspbmc Raspberry Pi. Specifically, I've had to manually specify the following in ~/.bashrc. export LANG='en_AU.UTF-8" ...
2
votes
0answers
272 views

Reading from /etc/environment with sudo

Using Ubuntu 14.04 LTS, I'm having a problem trying to read environment variables from /etc/environment when using sudo env. Basically, they are not being displayed. When I do just env, these ...
14
votes
3answers
942 views

Using variables to store terminal color codes for PS1?

In my .bashrc, I use ANSI terminal color codes to colorize various bits. It looks like this: PS1='\u@\h:\w\[\033[33m\]$(virtual_env)\[\033[32m\]$(git_branch)\[\033[0m\]$ ' where virtual_env and ...
16
votes
2answers
598 views

How do I start all shell sessions in a directory other than $HOME?

When I open my non-login shell in Ubuntu, my present working directory is /home/user_name (my $HOME environment variable), but I want to change this such that when I start my terminal I am in some ...
0
votes
2answers
66 views

Why do I have to execute bash programs with ./? [duplicate]

Why is it that some bash programs will only run on my system when I type ./ before their name? An example: In my [...]/android/sdk folders I have to execute adb like this: ./adb devices Why not ...
3
votes
3answers
1k views

Messed up bash.bashrc file, commands not working anymore

Trying installing Java, I tried to add it to the executable path with the line: export PATH=/usr/lib/jvm/jdk1.7.0_60/bin:$PATH in the system-wide /etc/bash.bashrc file. For some reason this ...
2
votes
1answer
463 views

Bash script for running python virtual environment does not execute

I am trying to wrap the following call into a script, which runs my Python virtual environment: [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ source ...
1
vote
0answers
31 views

Programmatically obtain LILYPOND_DATADIR for execlp() call

I wrote an application that calls lilypond by execlp()ing it. However, when my app executes this line, the following error occurs: GNU LilyPond 2.16.2 warning: not relocating, no 2.16.2/ or current/ ...
8
votes
4answers
194 views

Save output of command that modifies environment into a variable

How to save output of a command that modifies environment into a variable? I'm using bash shell. Assume that I have: function f () { a=3; b=4 ; echo "`date`: $a $b"; } And now, I can use commands ...