DEV Community

Discussion on: Writing Bash Scripts Like A Pro - Part 1 - Styling Guide

indreias profile image
Ioan Indreias

I'm usually set environment variables for the Bash scripts (or any other executable) like:
$ USER_NAME="Julia" USER_AGE="36"

unfor19 profile image
Meir Gabay Author

Depends on the context ...
For local usage, sure, that works great.

For CI/CD processes, usually, values/secrets are injected with env vars ...

My mindset - fetch default values from env vars. A matter of approach/opinion I guess

psvpl profile image
Piotr Szeptynski

Me too. That's better than exporting them to the env.