I am searching for example of file which could be passed to the augeas:
augeas --f example/file
So far my file looks like this:
set /files/etc/hosts/01/ipaddr 127.0.2.1
set /files/etc/hosts/01/alias[1] testy
set /files/etc/hosts/01/alias[2] test
save
And if I pass the file to the augeas it tells me this:
error: Failed to execute command
saving failed (run 'print /augeas//error' for details)
Obviously, I did what the command line told me:
janipav@janipav:~$ print /augeas//error
Warning: unknown mime-type for "/augeas//error" -- using "application/octet-stream"
Error: no such file "/augeas//error"
So, I am pretty much stuck here. Googling did not provide me anything, so I hope to find answer here. Thanks
The
canonical
node is mandatory forhosts
entries with theHosts.lns
lens, so you need:Note that this change is not idempotent, it will create a new entry at every run.