Editing files in place
Basic pattern
dasel -i <format> --root '<query>' < file > file.tmp && mv file.tmp fileExamples
Update a value in a TOML file
dasel -i toml --root 'foo = "bar"' < config.toml > config.toml.tmp \
&& mv config.toml.tmp config.tomlUpdate a value in a JSON file
dasel -i json --root 'settings.theme = "dark"' < config.json > config.json.tmp \
&& mv config.json.tmp config.jsonAdd a new field to a YAML file
Shell function for convenience
Why use a temporary file?
Last updated