Tagged Questions

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

learn more… | top users | synonyms

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
46 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
22 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
193 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
47 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
75 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
60 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
48 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
94 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
198 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
154 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 ...
-1
votes
0answers
31 views

Latest Bash shell hack [duplicate]

What is all this recent fuss about Bash being vulnerable? I read that it is somehow related to environment variables but could not get a hold of it. Can someone explain this vulnerability to me?
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
0answers
31 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
35 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
53 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
84 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
56 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
60 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
40 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 ...
2
votes
0answers
149 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
97 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
119 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
59 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
35 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
167 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
145 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
57 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
266 views

Echo difference between Ubuntu and Red Hat

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
136 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
64 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
304 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
343 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
866 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
232 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
171 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
81 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
235 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
745 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 ...
15
votes
2answers
516 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
65 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
631 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
399 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
186 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 ...
1
vote
1answer
69 views

Multiple MODULEPATH entries in .modulesbeginenv

I'm switching between paths/code projects. At each place I have different modules. To handle this there is a setup script that modifies what to use. This is handled with the tool 'module'. NOTE: ...
0
votes
0answers
32 views

Parameters files, pfiles director: how to overwrite default settings

This is a quite general question that I am not sure to be able to address correctly. I must manage some bash or tcsh scripts that invoke other software's tools. These tools are invoked by name and ...
4
votes
1answer
914 views

how to set environment variables from a shell script? [duplicate]

I'm trying to set environment variable through a shell script. Here is the script with various techniques: #!/bin/sh echo "export SOMEPATH=/root/some" >> /root/.bash_profile echo "export ...
6
votes
2answers
253 views

if statement in .bashrc not working correctly

I set up .bashrc to show a long prompt if the terminal is at least 80 characters wide. Otherwise it shows a degraded, smaller prompt. I use an if statement to achieve this: dp_smaller_than=80 if [ ...