Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throwing set -a and set +a around a variable pair list #28

Closed
stuartpb opened this issue Jan 15, 2015 · 2 comments
Closed

Throwing set -a and set +a around a variable pair list #28

stuartpb opened this issue Jan 15, 2015 · 2 comments

Comments

@stuartpb
Copy link

set -a makes it so that every assignment has an implicit export in front of it. set +a turns this off.

This makes it really easy to keep configuration in a file like this (which is compatible with Docker's --env option and EnvironmentFile in systemd):

SECRET_BASE=qweasd4321
SPECIAL_KEY=ghfdwqu98

and then export its variables (eg. setting up an environment for a script):

set -a; . config_file; set +a
@progrium
Copy link
Owner

More of a pro-tip than a style issue. These really aren't actionable for me, but I do encourage you to start a guide or something.

@stuartpb
Copy link
Author

Yeah, this was the tip I was thinking of in #20 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants