Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
> # create input files
> ( echo a=5; echo b=7 ) | name-value-convert --to=xml > default_config.xml
> ( echo a=6; echo c=8 ) | name-value-convert --to=json > customised.json

> # combine configs
> name-value-apply default_config.xml customised.json
a="6"
b="7"
c="8"

 
> # check where each path-value pair came from
> name-value-apply default_config.xml customised.json --source
a="customised.json"
b="default_config.xml"
c="customised.json"
 
> # output as json
> name-value-apply default_config.xml customised.json | name-value-convert --to json
{
    "a": "6",
    "b": "7",
    "c": "8"
}
 
> # as usual, you can do it on the fly, e.g. if you would like to override parameters with command-line options
> name-value-apply default_config.xml customised.json <( echo c=10 )
a="6"
b="7"
c="10"