[augeas-devel] Calling augtool from a script

Damon Conway damon.conway at alchemysystems.com
Tue Apr 23 17:37:50 UTC 2013


On 04/23/2013 12:24 PM, Graham Leggett wrote:
> Hi all,
>
> According to the FAQ entry at http://augeas.net/faq.html, the augtool command can be used to manipulate the tree from a script, but there doesn't seem to be a link to any documentation that would describe how to do this with working examples.
>
> The closest I've found is the url http://stackoverflow.com/questions/9118123/using-sed-to-change-etc-fstab however trying to follow it's example I get augtool running silently with no error, but not doing anything to the file /etc/fstab:
>
> augtool set '/files/etc/fstab/[file=/home/monica/foo]/file' /home/monica/foo
> augtool set '/files/etc/fstab/[file=/home/monica/foo]/spec' /dev/vg001/home-monica-foo
> augtool save
>
> Does anyone have a working example of augtool being run from a script?

Not I.  Only using augeas from puppet thus far.

> Does anyone know how to get some kind of diagnostics or debugging out of augtool, to confirm that it is actually doing anything?

I know that 'print /augeas//error' will give you debugging info.

Damon




More information about the augeas-devel mailing list