Environment variable - GradedJestRisk/linux-training GitHub Wiki

Environment variables

https://barker.codes/blog/loading-dot-env-files-in-a-unix-shell/

bash

The file containing environment variable definition can be anywhere, not only in the local folder.

FOO=bar

Set from .myenvfile

export $(grep -v '^#' .myenvfile | xargs)

Unset from .myenvfile

unset $(grep -v '^#' .myenvfile | awk 'BEGIN { FS = "=" } ; { print $1 }')

direnv

List:

  • load .envrc file
  • regular package

here

Make it load .env file, see here

dotenv

List:

  • load .env file
  • zsh pluhin

Here

fish

Use (set -U)[http://fishshell.com/docs/current/cmds/set.html]