I normally use Github for my dotfiles. For a gem I am working on, I need to add some private keys to my .zshrc
.
Is there a way for me to include another file in my .zshrc
, where I can store my environment variables in that included file?
I normally use Github for my dotfiles. For a gem I am working on, I need to add some private keys to my .zshrc
.
Is there a way for me to include another file in my .zshrc
, where I can store my environment variables in that included file?
Yes, by using the source
command:
# environment variables
source ~/.zsh_env_vars
You can add this to your .zshrc or .zshenv file to iterate through a directory. That makes it possible to seperate your variables. Maybe you want to have a specific file for $PATH and one for your ruby variables, ...
for file in ~/.zsh_variables/*; do if [ -f "$file" ]; then source "$file" fi done
© 2022 - 2024 — McMap. All rights reserved.
export MY_ENV_VARIABLE_NAME="xxxxxxxxxxxxxxxx"
. – Troxler