Traditionally, this would be a job for m4:<p><pre><code>    $ cat examples&#x2F;config.yaml.in 
    user: USERNAME
    password: ifelse(PASSWORD,`PASSWORD&#x27;,`defaultpass&#x27;,PASSWORD)
    files:
    patsubst(esyscmd(`ls&#x27;), `.+$&#x27;, `  - \&amp;&#x27;)

    $ m4 -DUSERNAME=somebody examples&#x2F;config.yaml.in
    user: somebody
    password: defaultpass
    files:
      - README.m4
      - examples
      - sempl</code></pre>