All Questions
13 questions
2
votes
1
answer
3k
views
What is the Bash equivalent to .zshenv?
I've read that .bashrc (like .zshrc) is meant only for interactive logins (and the one non-interactive exception of remote shells). But where should environment variables for Bash be placed that is (...
0
votes
2
answers
1k
views
PATH is not empty after /usr/bin/env -i /bin/bash --norc --noprofile
I cannot make sense of the results below:
/tmp/% /usr/bin/env -i /bin/bash --norc --noprofile
bash-5.0$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.
I expected PATH to be ...
4
votes
1
answer
11k
views
Passing env variables to a ssh connection
I want to pass enviromental variables to a ssh connection. They should be passed dynamically, therefore hard-coding them into the config file of ssh
won't work for me.
I've tried this:
AAA="...
2
votes
0
answers
1k
views
Set permanent environment variable for all shells
I want to set the root level environment variable that comes from sh(1) so that it is shared across all shells: sh, bash, zsh, and fish.
I can see in /etc/profile there's a command /usr/libexec/...
2
votes
3
answers
909
views
How to capture stderr of function that modifies current environment?
The module function of the Environment Modules1 package does its work by modifying various environment variables of the current shell process.
Unfortunately, this function returns 0 whether it ...
1
vote
2
answers
1k
views
Storing all environment variables in one file
What are the caveats of having one single file with environment variables?
What I would like to do is to create a file (e.g. ~/.env) which contains all necessary PATH declarations and possibly other ...
10
votes
1
answer
2k
views
Why can't I print a variable I can see in the output of env?
I am interested in setting environmental variables of one shell instance from another.
So I decided to do some research.
After reading a number of questions about this I decided to test it out.
I ...
29
votes
7
answers
16k
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 ...
45
votes
4
answers
48k
views
How can I list all shell variables?
Reading about this question: In zsh how can I list all the environment variables?, I wondered, how can I list all the shell variables?
Also, does the distinction between shell variables and ...
2
votes
1
answer
346
views
$@ and 'set env $PATH' - Why should this statement go into .inputrc?
I have a line in my .zshrc that says:
set env $PATH
Apparently this affects the value of $@. I have read that $@ should be empty and that I should not have any set statements in my .zshrc (at least ...
7
votes
2
answers
7k
views
How to print apparently hidden environment variables?
Environment variables can be shown with env; but, some are not shown. For example...
echo $EUID might produce as result of 1000 yet
env | grep EUID produces no result.
What is this type of variable? ...
1
vote
2
answers
3k
views
OS X setting environment variables
I have OSX 10.8.2 with ZSH as my shell and iTerm as a terminal (don't know if the last thing is relevant). I have to mention that I'm relatively new to OSX.
I'm trying to set up some environment ...
7
votes
2
answers
939
views
Inhibit Variable Expansion in Paths
How do I prevent Zshell (and Bash I assume) from expanding environment variables in paths be completed as shown in the following example:
$PREFIX/alt/li
should expand to
$PREFIX/alt/lib
and not to ...