Search⌘ K
AI Features

Setting Our Own Variables

Explore how to create and manipulate shell and environment variables to control your command-line interface setup. Learn to store data securely, make variables available to programs, and customize tool behavior for efficient shell use.

Environment variables

We can set our own environment or shell variables in addition to the ones set up for us. This is helpful when we have to store long strings like API keys, access tokens, or credentials. Many web frameworks and applications use environment variables to store database credentials and other sensitive information to keep it out of the code.

Creating a new variable

Let’s try it out. We create a new shell variable named SHIELD_PASSWORD and assign it the value of 12345, and then we ...