All Questions
Tagged with zsh environment-variables
73 questions
1
vote
1
answer
238
views
Why is FPATH not listed in `env` output?
I'm running zsh (on MacOS) and I just learned about $fpath.
As usual, I then typed env to check it participating in my environment but to my surprise it was not there! Yet, $FPATH (and $fpath) is ...
1
vote
1
answer
203
views
some_variable vs some-variable in zsh
Why is it that zsh seems to understand what to do with some_variable=1 command, but not some-variable=1 command? E.g.: $ fs_screen=1 mpv --fs-screen=${fs_screen} someFile.mp4 works fine but $ fs-...
-3
votes
1
answer
81
views
Bash variable ${DIRSTACK[@]} for zsh [closed]
What the Zsh equivalent of Bash's ${DIRSTACK[@]} variable?
0
votes
1
answer
112
views
zsh: How can I escape each word separately?
How can the following list of commands can be quoted separately?
s="cp
mkdir
[[
mv
rm"
quoted_s= ????
This should be the output of echo $...
1
vote
1
answer
3k
views
Variable Scope in ZSH: How to access global variables from within function?
I have an ever-expanding .zshrc file that was getting out of hand so I decided to try to fix it by breaking it into modular files and sourcing each of them. This works for the most part, but I seem ...
0
votes
1
answer
298
views
A script /etc/profile.d/{script1}.sh doesn't work correctly
cat /etc/profile.d/atlassian-plugin-sdk.sh
export PATH=$PATH:/opt/atlassian/plugin-sdk/bin
ls -al /etc/profile.d/atlassian-plugin-sdk.sh
-rwxr-xr-x 1 root root 48 Apr 17 21:36 /etc/profile.d/...
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 (...
1
vote
2
answers
2k
views
How to use an environment variable to store a flag in zsh?
I'm working with kubectl and zsh, and I would like to store the namespace flag in an environment variable.
Instead of writing:
kubectl get pods -n mynamespace
I would like to do something like:
n='-n ...
4
votes
1
answer
4k
views
Automatically set an environment variable to be equal to another variable
I would like to create an environment variable which is an "alias" of another environment variable. i.e. whenever the original variable changes, this alias variable changes with it. How do I ...
8
votes
2
answers
14k
views
Export Multiple LDFLAGS, CPPFLAGS, PKG_CONFIG_PATH in a zshrc File
In my .zshrc file I have existing exports for OpenSSL.
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export ...
11
votes
1
answer
6k
views
Why does echo "$ZDOTDIR" return nothing?
Background
In Chapter 5 of the ZSH manual it states:
Commands are first read from /etc/zshenv; this
cannot be overridden...Commands are then read from
$ZDOTDIR/.zshenv.
Issue
I wanted to view what ...
0
votes
2
answers
3k
views
I cannot set env variable on zsh
I am using Kali linux:
lsb_release -a
"
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2021.2
Codename: kali-rolling
"
i set env variable
export DB_USER=...
4
votes
1
answer
3k
views
ssh: force different shell for non-interactive command execution
how can I force specific shell to be used for non-interactive command execution via ssh on remote server?
My default shell on the remote server is zsh, but I need to execute given command using /bin/...
0
votes
1
answer
16k
views
Changing PATH Variable in zsh
I want to change my PATH variable in zsh.
Problem: I don't understand where in the .zshrc file I have to make modifications.
Normally, I would look for the assignment to the PATH variable and set the ...
0
votes
1
answer
496
views
Global Variables across scripts [duplicate]
Why is lets say HOME recognized by all my scripts but my variable DMENU isn't?
I export it in my bspwmrc file which is executed at start up.Also had it in my zshrc.
Why do this?
DMENU="-h 27 -z ...