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

learn more… | top users | synonyms (1)

3
votes
2answers
341 views

Where do EDITOR, PAGER, BROWSER environment variables come from?

When I look in man bash none of these are defined. However, random posts online refer to them; where do they come from? Or are they just a convention?
0
votes
1answer
9 views

OracleSolaris 11.2 - setting MANPATH variable

What is the right way to extend MANPATH in Solaris? Currently it is empty for a user session, so I get to do it manually in $HOME/.bash_profile: ...
3
votes
3answers
38 views

What's the 'right' format for the HTTP_PROXY environment variable? Caps or no caps?

I've encountered both http_proxy and HTTP_PROXY. Are both forms equivalent? Does one of them take precedence over the other?
1
vote
1answer
16 views

How to switch java environment for specific process?

I use openjdk in my work, but sometimes I need oracle's jre or even specific version of oracle's jre. As I know, I should update JAVA_HOME value and /usr/bin/java or /etc/alternatives/java link ...
0
votes
1answer
18 views

How to change JAVA_HOME temprorary with env command

I use openjdk for my work, but sometimes I need oracle's JRE. I thought that I could use 'env' command for this, but can't figure out why it's not working. I have openjdk in ...
1
vote
1answer
26 views

Magic environment variables in gnome-terminal

I had installed a proxy software (cntlm) on my machine. It sets the environment variable http_proxy to 127.0.0.1:3128. Now I've uninstalled the program using apt-get remove cntlm. However I'm able ...
1
vote
1answer
20 views

How to append to an environment variable using an .env file?

Assuming the .env file is loaded before execution, how can you append to it without overriding it? DEBUG=True FOO=BAR PYTHONPATH="/Users/James/project/" The above file would (?) override it, and ...
0
votes
2answers
28 views

Does kali distro not use /etc/environments file?

I appended a path to /etc/environments file and now it is like so: mindaugas@Kali:~$ cat /etc/environment | tr ":" "\n" PATH="/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /sbin" I ...
1
vote
1answer
37 views

How do I add an installed program to my PATH so I can run it from the command line?

I installed jsx using npm: npm install -g jsx Now it installed jsx in this path: /node_modules/lib/node_modules/jsx/bin In the bin, I'm having jsx. Now if type ./jsx, it works fine as expected. ...
1
vote
4answers
70 views

Is there a CLI tool that would prettify a JSON string [closed]

On my host I enter the following, which returns a bunch of information which isn't particularly easy to read at the CLI. echo $ENV_VAR | base64 --decode Is there a way to format it? This is a ...
2
votes
1answer
24 views

Unset all ENV variables matching _PROXY

I'm trying to unset all environment variables that match _PROXY: env | grep -i _proxy | column -t -s '=' | awk '{ print $1 }' | grep -iv 'no_proxy' | xargs -0 -I variable unset variable but it's ...
2
votes
1answer
100 views

what is the use of “export” command

I created a environment variable in one terminal window and tried to echo it in another terminal window. That displayed nothing. $TEST=hello After that I exported it and tried again to echo it in ...
1
vote
1answer
73 views

HOME is not set when exploiting a vulnerability

Can you help me solve this error? sh: line 61: cd: HOME not set. Distribution: Metasploitable 2 (Ubuntu 8.04) /root/.bashrc (comments and whitespace removed): [ -z "$PS1" ] && return ...
3
votes
3answers
90 views

How to set HOSTNAME in zsh?

In bash, which sets $HOSTNAME for you, I was able to calculate the total length of prompt line simply by using something like: PS1_length=$((${#USER}+${#HOSTNAME}+${#PWDNAME}+12+${#PS1_GIT})) It was ...
0
votes
0answers
13 views

Can I run a single program without running it through a window manager? (Gnome, Technic-Launcher)

I'm running into an issue with Technic-Launcher being completely white when run in gnome, but it's fine in other DE's. The developer says it's an issue with mutter and undecorated java windows. Can I ...
1
vote
1answer
20 views

How to correctly set the XDG base dirs gobally and dynamically

I get a lot of config folders in my homefolder. I assume that is, because $XDG_CONFIG_HOME is not set and some software (e.g. fontconfig, umlet) does not follow the standards. $XDG_CONFIG_HOME ...
2
votes
2answers
70 views

Zsh: export: not valid in this context

When running this script, I run into an error on this line (relevant snippet below): ... _NEW_PATH=$("$_THIS_DIR/conda" ..activate "$@") if (( $? == 0 )); then export PATH=$_NEW_PATH # If ...
15
votes
3answers
784 views

Issue an error when using empty shell variables

Sometimes I use, $PROJECT_HOME/* to delete all files in the project. When the environment variable, PROJECT_HOME is not set (because I did su and the new user doesn't have this environment variable ...
1
vote
0answers
27 views

If processes can't modify their parent's environment, what is MC doing?

As far as I know, a process cannot modify its parent's environment. However, when I run mc (GNU's Midnight Commander, a curses-based file manager) and then quit it, I end up with another $PWD: ...
0
votes
1answer
38 views

Fixing a broken PYTHONPATH environment variable

I recently installed some software, which required python to operate. For some reason, it installed its own version of python, and modified the PYTHONPATH variable. Now, when I attempt to import a ...
0
votes
0answers
29 views

Computer won't load if I comment out sourcing bashrc from .profile? [duplicate]

I am trying to understand the difference/application of system files like .profile/.bash_profile/.bashrc etc. Now, I understand that .profile will be sourced when I login to the computer routinely ...
0
votes
0answers
51 views

$PATH variable on Fish Shell OS X

I have somehow screwed up my path variables with Fish shell on OS X. Is this the proper $PATH variable in the config.fish? user@host ~> more ~/.config/fish/config.fish set -g -x PATH ...
5
votes
2answers
228 views

Can you execute a Bash function with the `at` command?

I want to execute a Bash function at a scheduled time. I think the right tool for this is the at command. However, it doesn't seem to be working. function stupid () { date } export -f stupid ...
3
votes
2answers
81 views

What is the difference if I start bash with “/bin/bash” or “/usr/bin/env bash”? [duplicate]

In shell scripts one specifies language interpreter on shebang(#!) line. As far as I know, it is recommended to use #!/usr/bin/env bash because env is always located in /usr/bin directory while ...
2
votes
1answer
70 views

How to safely transmit a password over SSH for a remote command to use

On the local server, I have a program that stores the password in the predefined environment variable (SPECIAL_PASSWORD). On the remote server I have a program that reads and uses a password from a ...
4
votes
1answer
50 views

Settings environment variables from a file

I want to have a file (outside of git) that contains certain environment variables. While a script (which is in git) needs to read them and export to env. My current implementation works for ...
0
votes
2answers
85 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
59 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
81 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
2answers
314 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
102 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
44 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
8 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
59 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
123 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
81 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
57 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
64 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
43 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
106 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
62 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
58 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 ...
3
votes
2answers
169 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
37 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
29 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
316 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
46 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
71 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
34 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
180 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 ...