How To Batch-set Environment Variables
Learn how to automatically (dump) set environment variables defined in a file.
Sometimes you have a file (usually called
The solution is easy:
Sometimes you have a file (usually called
.env
or .environment
) with dozen of environment variables defined and you have to set those variables before running a command --for example this happens in Django projects with a .env
file for settings.The solution is easy:
export $(cat ENVIRONMENT_FILE | xargs) && YOUR_COMMAND
Comments
Post a Comment