-
Notifications
You must be signed in to change notification settings - Fork 0
Environmental Variable Setup
Mack edited this page Sep 20, 2023
·
3 revisions
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.
- Use this to set a temporary env var in this command prompt instance only:
set VARNAME="content"- 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:VARNAMEVerify that it reads back correctly.
Mac users, you can do pretty much the same thing by a different method:
export VARNAME=contentMaking 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 $SHELLThen 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/wantThen reload your console, you can use a console prompt for that:
source ~/.bash_profileWhatever works for you!