Skip to main content

All 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 ...
Brandt's user avatar
  • 334
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-...
Harv's user avatar
  • 2,420
-3 votes
1 answer
81 views

Bash variable ${DIRSTACK[@]} for zsh [closed]

What the Zsh equivalent of Bash's ${DIRSTACK[@]} variable?
user avatar
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 $...
Udi's user avatar
  • 193
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 ...
undefined's user avatar
  • 123
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/...
perelium's user avatar
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 (...
iconoclast's user avatar
  • 9,362
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 ...
Ortomala Lokni's user avatar
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 ...
ogb119's user avatar
  • 41
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 ...
secondman's user avatar
  • 237
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 ...
user avatar
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=...
Yilmaz's user avatar
  • 417
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/...
Martin Vegter's user avatar
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 ...
aurumpurum's user avatar
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 ...
Lampros's user avatar
  • 143

15 30 50 per page
1
2 3 4 5