我正在搜索可以传递给augeas的文件的示例:
augeas --f example/file到目前为止,我的文件如下所示:
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如果我把文件传递给augeas,它会告诉我:
error: Failed to execute command
saving failed (run 'print /augeas//error' for details)显然,我做了命令行告诉我的事情:
janipav@janipav:~$ print /augeas//error
Warning: unknown mime-type for "/augeas//error" -- using "application/octet-stream"
Error: no such file "/augeas//error"所以,我被困在这里了。谷歌没有提供给我任何东西,所以我希望在这里找到答案。谢谢
发布于 2013-12-11 12:55:45
对于带有canonical镜头的hosts条目,Hosts.lns节点是必需的,因此您需要:
set /files/etc/hosts/01/ipaddr 127.0.2.1
set /files/etc/hosts/01/canonical localhost2
set /files/etc/hosts/01/alias[1] testy
set /files/etc/hosts/01/alias[2] test
save请注意,此更改不是幂等的,它将在每次运行时创建一个新条目。
https://stackoverflow.com/questions/20517974
复制相似问题