4 ms·
Augtool from the Augeas project too. (As well as the mentioned gron)
by emmelaich 6y ago
Augtool from the Augeas project too. (As well as the mentioned gron)
- emmelaich 6y agoexample $ augtool -r . --noautoload --transform "Json.lns incl /sirdb-example.json" <<EOF > print /files/sirdb-example.json/ > EOF /files/sirdb-example.json /files/sirdb-example.json/dict /files/sirdb-example.json/dict/entry[1] = "_owner" /files/sirdb-example.json/dict/entry[1]/string = "nouser" /files/sirdb-example.json/dict/entry[2] = "username" /files/sirdb-example.json/dict/entry[2]/string = "nouser" /files/sirdb-example.json/dict/entry[3] = "email" .... etc ...
- chousuke 6y agoI find it unfortunate that augeas is so magical. Or rather, the design of its interface is very surprising What's up with requiring "--noautoload"? What does "-r ." do? and the transform invocation starts with the seemingly magical "Json.lns" (where does it come from?) and appears to refer to a file at the root of the filesystem hierarchy? I'd probably use augtool more often myself, but its UI is seriously inscrutable.
- emmelaich 6y agoI agree, fwiw. I'm writing a little program to make this whole lot easier. Answers: by default, augtool loads all the lenses and scans the entire default filesystem (typically /etc); `--noautoload` prevents that. The -r is `--root`; specify the root as the current directory rather than /