Skip to main content

Questions tagged [environment-variables]

Environment variables are used to create shared settings that persist between invocations of applications. They are used to provide information such as paths to important directories, user information and other information programs need for common tasks.

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

There seems to be a consensus that the PATH for macOS (any version) is some value set (exclusively) in /etc/paths and user-maintained shell scripts (notably /etc/profile and ~/.profile as well as ...
Dennis 's user avatar
  • 125
0 votes
0 answers
112 views

On a Mac running macOS 13.5, $TMPDIR is not set in a new shell. This is a multi-user machine, and it is unset for all users that are sued to, causing multiple issues since libraries may default to /...
slhck's user avatar
  • 2,274
0 votes
1 answer
397 views

I am using zsh and I wanted to modify the $PATH variable permanently. I can't seem to find either .zshrc or .zsh_profile on my computer -- I tried searching in Finder with enabled hidden files. I ...
dnes's user avatar
  • 99
3 votes
2 answers
304 views

I'm using launchd to set an env var at startup using launchctl setenv. The script works fine when the variable is hardcoded in it, but unfortunately I need to get this variable dynamically at startup ...
VMX's user avatar
  • 141
3 votes
3 answers
2k views

When I use the "run shell script" in automator, and do, for example say $PATH it then tells me the PATH. But the path is incomplete. Some items I have in $PATH when using the terminal (zsh) ...
Ma Joad's user avatar
  • 461
2 votes
1 answer
82 views

Running zsh on macOS Ventura → With sudo --preserve-env -s the environment variable ZDOTDIR is not preserved but all the others are. → With sudo --preserve-env=ZDOTDIR -s the variable ZDOTDIR is ...
Damien L's user avatar
  • 259
1 vote
0 answers
217 views

When I start a Terminal (in Monterey 12.2.1) my LANG is sv_SE.UTF-8, which is fine. When I start a shell, or any other sub-process that reads environment, from GUI Emacs it is set to LANG="en_SE....
thoni56's user avatar
  • 151
1 vote
2 answers
2k views

If I do sudo zsh, I can tell I am in zsh by examining ps -ef Is there an easier way? echo $SHELL says it's /bin/sh, because $SHELL is always the default shell, not necessarily the shell that's ...
WGroleau's user avatar
  • 5,412
4 votes
1 answer
296 views

EDIT in 2023: I have macOS 13.2 Ventura and vscode 1.74.3 installed now, and this problem isn't reproducing the same way anymore. It looks like this is due to a relatively new vscode feature, Terminal ...
Carl Walsh's user avatar
5 votes
4 answers
2k views

I've been struggling with a very weird issue. I'm trying to use libgmalloc (eg per man 3 libgmalloc) on Big Sur (I'm on 11.3.1) to trouble shoot a memory issue in my code. However, I can't set the ...
StuartStaniford's user avatar
2 votes
1 answer
325 views

Summary How can I execute scripts from the system-wide Script menu with a normal environment? It seems the environment is not being setup at all. Scripts that are run from the script menu can find and ...
Mat Gessel's user avatar
2 votes
4 answers
521 views

I'm a software developer and I often have to switch between different projects, each with its own environment setup. Some actions I have to do each time include: creating ssh tunnels connecting ...
Carlo Moretti's user avatar
0 votes
0 answers
826 views

I use the environment.plist method to setup global variables in macOS. I have this template in ~/Library/LaunchAgents <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ...
Damien L's user avatar
  • 259
4 votes
2 answers
971 views

Hey I ran export TMPDIR=~/tmp/ and it changed my temp folder. I was trying to get a Go backend working and an article suggested it. I was a little trigger happy and now this is causing issues with a ...
flynnstone9's user avatar
2 votes
0 answers
262 views

Considering the current version of macOS being Catalina, I am looking for a way to set permanently an environment variable for both: bash and GUI applications. I have searched online for a while, but ...
Adrian Maire's user avatar
205 votes
1 answer
267k views

Now that I've upgraded to Catalina and I am using the new ZSH shell, I've noticed that ~/.bash_profile has been replaced with ~/.zprofile and since installing iTerm2 shell integration, it added a ~/....
Allan's user avatar
  • 106k
1 vote
1 answer
155 views

I have been trying to edit my environment variables. I referred to the sites but its not working. I should mention that I am very new to Mac and I'm using it because my workplace has it. When I enter ...
Akash's user avatar
  • 11
0 votes
2 answers
2k views

I'm trying to use Node.js on my work computer but I don't have admin rights. I'm wondering how I can install Node.js on mac without having admin rights. I found a tutorial, which is for Windows but ...
taylor018's user avatar
  • 117
0 votes
1 answer
7k views

I am trying to set permanent environmental variable in my mac machine I have tried following steps till now - vi ~/.bash_profile adding my variable export JAVA_HOME=/Library/Java/...
Dilip's user avatar
  • 103
2 votes
2 answers
984 views

I'm trying to set an environment variable for Anki's media folder, in .bash_profile. The line is export ANKI_MEDIA='/Users/<username>/Library/Application Support/Anki2/me/collection.media'. ...
WobblyWindows's user avatar
0 votes
0 answers
215 views

I'm following this guide on how to build NumPy with Intel MKL on a macOS (I'm on Mojave 10.14.5), and after installing Intel's MKL library, the guide tells me to set LD_LIBRARY_PATH: export ...
Mahi's user avatar
  • 101
7 votes
1 answer
1k views

On my system, I'm trying to set up SSH authentication through my GPG agent (installed via brew). So far, I have this working in my terminal thanks to adding the following lines to ~/.profile: # ...
Kaz Wolfe's user avatar
  • 470
1 vote
1 answer
137 views

I want to create a cron job. Launching a terminal window, and entering crontab -e opens my current crontab, but opens it in the editor vi. I would prefer to use the nano editor. How do I configure ...
Seamus's user avatar
  • 5,329
5 votes
1 answer
2k views

I want to set some environment variables in my Mac. I was hoping to do that by creating a small bash script file inside paths.d and then restart my machine. Is this the correct way to add ...
ha9u63a7's user avatar
  • 201
3 votes
3 answers
1k views

I've read a dozen different answers and talked to a bunch of people and am having difficulty understanding how PATH is calculated in different scenarios. Specifically I'm thinking of How exactly is ...
George Mauer's user avatar