Skip to content

Environmental Variable Setup

Mack edited this page Sep 20, 2023 · 3 revisions

Setting up Environment Variables

Env Var declaration is OS dependent, and can be tricky, so detailed instructions are below for the novice to command line tools and using shells.

Windows

  • Use this to set a temporary env var in this command prompt instance only:
set VARNAME="content"

Persistent settings

  • With admin privileges, you can set a persistent env var:
setx VARNAME "content"

Verify the changes took, which might require reloading your command prompt. Check with the following:

echo $ENV:VARNAME

Verify that it reads back correctly.



Mac/Linux Users

Mac users, you can do pretty much the same thing by a different method:

export VARNAME=content

Persistent settings

Making the env var persist within a MacOS environment requires some slight changes to the config of your shell, which should be somewhere like /bin/bash. Use:

echo $SHELL

Then we edit the profile of your terminal of choice (generally zsh or bash, directions below are for bash):

nano ~/.bash_profile
export export VARNAME=/content/you/want

Then reload your console, you can use a console prompt for that:

source ~/.bash_profile

Whatever works for you!

Clone this wiki locally