4 ms·
The article started out really well but ended too soon. Often you want a source of truth that is true for more than just your bash script. It should have incl
by wodenokoto 2y ago
The article started out really well but ended too soon.
Often you want a source of truth that is true for more than just your bash script.
It should have included a discussion about how sourcing config lets the config author execute code.
I also think you want to export these values. You source your config, maybe setup an environment and then execute a Python script that reads values from the environment.
Other things I was hoping for: a lot of modern tools come with config in json. Is there a reasonable way to read this into bash script?
- awesomerob 2y agoYeah the article is pretty terrible IMO. It seems to be pitched at folks who don't know any better, so just showing that you can use 'source' like a kind of config parser without pointing out that it totally just executes code is pretty reckless. I thought it was going to be something more like "here's a way to read KEY=VALUE lines into an associative array" (which is pretty easy, and can lead to all sorts of fun discussions/learnings about arrays in bash, subshells, whitespace/$IFS, etc)