Created
April 22, 2025 19:15
-
-
Save souhaiebtar/400b0f013a665229a7cf6d9b66e038cb to your computer and use it in GitHub Desktop.
[create environment Variable no history] create environment Variable no history #powershell #bash #zsh #environment #variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Powershell | |
# Prompt securely for the API Key | |
$apiKeyTemp = Read-Host "Enter your API Key" | |
# Set the environment variable using the temporary variable | |
$env:API_KEY = $apiKeyTemp | |
# Optional: Clear the temporary variable from memory | |
Remove-Variable apiKeyTemp | |
# Now you can use $env:API_KEY in subsequent commands in this session | |
# Example: Write-Host "Key set: $($env:API_KEY.Substring(0, 3))..." | |
---- | |
Linux/Macos | |
### bash, make command start with space character ignored-not saved in bash_history | |
export HISTCONTROL=ignorespace # ~/.bashrc | |
### zsh, make command start with space character ignored-not saved in zsh_history | |
setopt HIST_IGNORE_SPACE | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment