Many projects these days use more than one programming / scripting language, and in standard DRY tradition these should not have separate configuration files if they need the same information. After a small survey in /etc
, it looks like a lot of incompatible syntaxes are used in Ubuntu:
varname=value
-/etc/adduser.conf
varname: value
-/etc/debconf.conf
varname = value
-/etc/deluser.conf
$varname value
/etc/insserv.conf
varname value
-/etc/login.defs
set varname value
-/etc/lftp.conf
[section] varname = value
/etc/mke2fs.conf
section label varname value set varname value
/etc/smartd.conf
As far as I can see, none of these are "Yaml or XML or JSON," (one of them is INI though). Which format would you recommend (and why) for a project which needs to provide simple values (debug = true
, welcome = "Hello world!"
, threads = 4
), arrays of simple values (servers = [dev, test, prod]
), and values which refer to other variables (thread_msg = "Using $threads threads"
) to Bash, Perl and PHP?