From the course: Data Pipeline Automation with GitHub Actions Using R and Python

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Setting an environment variable

Setting an environment variable

- [Instructor] In this video, we will learn how to store the EIA_API_KEY as an environment variable on the Mac operating system. We will use the terminal to set the environment variable. There are a couple of ways to store environment variables in MacOS. We will use the .zshenv file, which as its name implies, it is designated file to store environment variables, which will be available to any application upon their launch. Let's now on the terminal open the .zshenv using Vim. I'm in the root folder, and the .zshenv file should be located under the root folder. So let's do Vim .zshenv, and here we go. And as you can see, the file is empty. To add the environment variable, click I to switch from the view to insert mode. As you can see, I clicked I, and now this is indicated I'm in insert mode. Now, let's set a variable by calling the variable EIA_API_KEY. I'm using all uppercase. You can choose either way. And let's assign the value. I copy/paste the value of my API key, and I will put…

Contents