How Do You Get Permanent Variables Set in the MacOS Terminal?

Problem scenario
You are using a Mac and you want an environment variable to be configured. What should you do?

Solution

  1. From a terminal, run this: echo $SHELL
  2. If you see /bin/zsh modify the ~/.zshrc to have the export statement that you need. You can learn more here.
    If you do not see "/bin/zsh", update the ~/.bash_profile file to have the export statement that you want. You are now done.

We tested this with macOS Catalina Version 10.15.7 on 12/29/20. To browse Mac products, see this link.

Leave a comment

Your email address will not be published. Required fields are marked *