0

This question already has an answer here:

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:

  1. What's happening?
  2. How can I fix it?
  3. Which file I have to use in macOS to set the env variable as a permanent variable

marked as duplicate by Kusalananda, Christopher, G-Man, Thomas Dickey, Jeff Schaller Feb 22 at 21:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I'm using bash shell – ger Feb 22 at 20:41
  • See the proposed duplicate question. The file you're after is (most likely) ~/.bash_profile. – Kusalananda Feb 22 at 20:43
  • @Christopher Or just printenv HTTPS (will get the value). – Kusalananda Feb 22 at 20:44
  • printenv HTTPS produces no result but set | grep HTTPS works! – ger Feb 22 at 20:48
  • You're setting a shell variable and not an environment variable... – Jeff Schaller Feb 22 at 20:58