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

learn more… | top users | synonyms

3
votes
2answers
341 views

What is $PWD? (vs current working directory)

So Wikipedia (link) tells me that the command pwd is short for "print working directory", and that makes sense. But for the environment variable, the "P" has to be an acronym for something else than ...
1
vote
0answers
21 views

systemd: default value for environment variable

I would like to migrate some OpenRC init script to systemd but I think that it is general problem of environment variables handling in systemd. Original OpenRC files There is a file e.g. ...
0
votes
1answer
35 views

Issue due to scope of environment variables

I had an Internet connection problem which turned out to be related to setting up the appropriate proxy environment variables. After adding lines like export ...
0
votes
1answer
31 views

Remove a folder with the same name as an environment variable

I was messing around with a log4j properties file and accidently made a folder with the following text ${foo} however I also have an environment variable named foo that points to a folder so thus if I ...
2
votes
1answer
73 views

clear out all variables without closing terminal

I want to know how to clear all variables which I defined in command prompt without closing terminal ? for example, if I set a variable in command prompt as: $ a=1 now I want to delete the ...
1
vote
1answer
82 views

Storing longer text output in memory in shell variables vs Writing to disk

I have the below call to db2 command line tool inside a loop which runs 100k iterations. (the db2 output is 5 rows of 20 chars approx per each call, total of approx 100k calls. The input to SP is ...
1
vote
2answers
23 views

Why is $COLUMNS not listed by either env or set? (on zsh)

I can $ echo $COLUMNS 95 and get a result, but if I env | grep COLUMNS or set | grep COLUMNS I get nothing. (Update: I just discovered that the behavior is different on bash. I'm using ...
1
vote
1answer
25 views

Exporting Variables from Read

I'm asking the user to input some data using Read that data will be save on a variable that is going to be use in another shell script. However, for some reason is not working. This is what I got in ...
0
votes
2answers
30 views

How can I expand all variables at the command line in Zsh?

In an earlier question, specific to bash, I asked How can I expand a relative path at the command line, with tab completion? I liked @Mikel's answer that mentioned using Ctrl+Alt+e to expand all ...
13
votes
1answer
233 views

Is there a difference between prepending a name-value-pair to a command and using env in bash?

Let's say I invoke A=B command and env A=B command in bash. Is there any situation where there might be a difference between both invokations?
0
votes
2answers
36 views

LD_LIBRARY_PATH always blank after sudo

I get shared library errors whenever I seem to install software manually. Upon executing echo $LD_LIBRARY_PATH it shows up as.. nothing. I've tried adding /usr/local/lib to a .conf file in ...
-4
votes
3answers
48 views

Data Types in UNIX [closed]

I have 2 questions. Q#1: data types & variables I have just begun reading UNIX and came across variable definitions. As per the site I'm referring UNIX variables are defined directly with a ...
0
votes
2answers
66 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
53 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
44 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
46 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
68 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
72 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
210 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
65 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
113 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
67 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
66 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
250 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 ...
8
votes
1answer
238 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
162 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
101 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
56 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 ...
3
votes
1answer
232 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
144 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
175 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
104 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
57 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
278 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
220 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
374 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
564 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
103 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
43 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
177 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
174 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
74 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
373 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
536 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
103 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
651 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: ...
2
votes
0answers
379 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 ...