I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
Given the format you've chosen for storing variables is the same as regular variable assignment in bash, could you explain the technical benefits of doing this beyond sourcing the configuration file with . ./variables.txt ?
file sometimes might not be a desired format, eg when dealing with secrets in CI environment, you want the secrets live in memory instead of stored in files.
sometimes you might be reading the variable name and value from external sources, eg. Vault. And the set of key/values are unknown ahead of time. In that case, you are not dealing with files directly, even though you can still use it as indirection.
in my case when I discovered the tricks, I wanted to declare the variables dynamically and export them at the same time. If we source the variables from variables.txt, you still need to export the variables separately
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Given the format you've chosen for storing variables is the same as regular variable assignment in
bash
, could you explain the technical benefits of doing this beyond sourcing the configuration file with. ./variables.txt
?I see a couple of practical benefits:
several benefits I can think of now:
variables.txt
, you still need to export the variables separately