Fill these in once
- Save it in your shell settings and load them
echo 'export MY_API_URL="https://api.example.com"' >> ~/.zshrc source ~/.zshrcFor secrets, a .env file in your project is usually safer than your shell settings.
Check it worked
- Check the value
printenv MY_API_URL
Undo it
- Remove it
sed -i '' '/^export MY_API_URL=/d' ~/.zshrc && unset MY_API_URL
- Save it in your shell settings and load them
echo 'export MY_API_URL="https://api.example.com"' >> ~/.bashrc source ~/.bashrcFor secrets, a .env file in your project is usually safer than your shell settings.
Check it worked
- Check the value
printenv MY_API_URL
Undo it
- Remove it
sed -i '/^export MY_API_URL=/d' ~/.bashrc && unset MY_API_URL
- Save it for your user
[Environment]::SetEnvironmentVariable("MY_API_URL", "https://api.example.com", "User")Close and reopen PowerShell afterwards.
Check it worked
- Check the value
[Environment]::GetEnvironmentVariable("MY_API_URL", "User")
Undo it
- Remove it
[Environment]::SetEnvironmentVariable("MY_API_URL", $null, "User")