I'm trying to set the environment variable HTTPS=true
in macOS bash shell but it doesn't work when I printenv
the variable HTTPS=true
doesn't appear:
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/kr/848p_nc116l4vvkbgkc_c1200000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.PkTkQaYUUc/Render
TERM_PROGRAM_VERSION=421.1
TERM_SESSION_ID=44933CE9-8A15-40AD-A534-286602490A93
USER=rh
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.6RrPiiuDzY/Listeners
PATH=/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/gerardo
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/rh
LOGNAME=rh
LC_CTYPE=UTF-8
SECURITYSESSIONID=186a8
_=/usr/bin/printenv
to set the env variable I used the commands set HTTPS=true
and HTTPS=true
I have 3 questions:
- What's happening?
- How can I fix it?
- Which file I have to use in macOS to set the env variable as a permanent variable
~/.bash_profile
. – Kusalananda Feb 22 '19 at 20:43printenv HTTPS
(will get the value). – Kusalananda Feb 22 '19 at 20:44printenv HTTPS
produces no result but set | grep HTTPS works! – Ger Feb 22 '19 at 20:48export HTTPS=true
. This creates an environment variable. He then didprintenv | grep HTTPS
and I suggested usingprintenv HTTPS
instead. – Kusalananda Feb 22 '19 at 21:00