💾 Archived View for tilde.pink › ~kaction › log › 2019-03-18.1.gmi captured on 2023-09-08 at 16:48:19. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
It just occurred to me, that environment variables are not necessary form valid shell variable name. For example,
$ env foo.bar=12 env | grep foo.bar foo.bar=12
Accessing variables with such unusual names is more elaborate in shell -- you have to use `printenv(1)`. In general-purpose languages, like C, Perl or Python there is no difference.
It means, that we could replace ini files with envdirs. For example, following config file
[section1] foo = 12 bar = 13 [section2] foo = 42
could be easily represented with following config directory, ready for use by `envdir(1)` from daemontools or `chpst -e` from runit suite.
/tmp/conf/ |-- section1.bar |-- section1.foo `-- section2.foo
It is sad, that git did not follow this way, and decided to use ini parser instead. Due its technical supremacy, Git project was able to do anything in non-convention way and it would be accepted and followed.