export command in Linux is used to set Environment variables, but you may not be aware that you can use the variables in other programming languages to prevent secrets from leaking in GitHub commits, etc.
Take the following example:
You've set an environment variable such as:
On your terminal prompt, you can check to ensure this variable works by running:
You can also take that same environment variable and make it accessible in Python with:
import os print(os.environ['HOME'])
on the flip side, you can do the same thing with .NET
var value = Environment.GetEnvironmentVariable("EMAIL"); Console.WriteLine(value);
Pretty neat, huh?
You can also checkout the video that I made showing this off in action before trying it on your own:
Video (5 mins)
Stay connected with me on social platforms for daily software development news.