Hello,
On Sat, Nov 24, 2012 at 2:43 AM, Graham Leggett <[email protected]> wrote:
> Hi all,
>
> I am trying to edit a postfix main.cf with with augtool, and am
> struggling with arrays.
>
> I can add a particular value to a given array with the set command, for
> example like this:
>
> augtool> set /files/etc/postfix/main.cf/virtual_alias_maps[last()] my-map
>
This will set the last element, even if it already exists. If you want to
add an element to the array, you should use:
set /files/etc/postfix/main.cf/virtual_alias_maps[last()+1] my-map
Note that this operation is not idempotent, it will add a new entry every
time you run it.
>
> I am struggling with the syntax to remove this value "my-map" again:
>
> augtool> rm [what-goes-here?]
>
If you want to remove all virtual_alias_maps values, simply use:
rm /files/etc/postfix/main.cf/virtual_alias_maps
If you only want to remove the last value:
rm /files/etc/postfix/main.cf/virtual_alias_maps[last()]
Cheers,
Raphaël
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel