On 24 Nov 2012, at 3:08 PM, Graham Leggett <[email protected]> wrote: > I don't want to remove the last value, I want to remove a specific value > "my-map", which may appear anywhere in the array (the removal in my case will > take place way after the addition, and other additions may have been made in > the mean time). > > Is there a way to reference the index of the array that contains that > specific value, like this? > > rm /files/etc/postfix/main.cf/virtual_alias_maps[(index-of-the-value-my-map)]
What turned out to be the syntax was the following: rm /files/etc/postfix/main.cf/virtual_alias_maps[.='my-map'] However, I've discovered that the postfix main.cf lens doesn't seem to explicitly model the "array" nature of postfix main.cf parameters like the following: inet_interfaces = $myhostname, localhost virtual_alias_maps = map1, map2, my-map, map3 Does augeas have any syntax to make modifications to a comma separated list, or is this a shortcoming of the postfix lens itself? Looking at the postfix lens, it seems to treat main.cf values as simple strings in their own right. To explain what I am trying to do, the setting of the map happens in an RPM postinstall script, and the removing of the map happens in a preremove script, and I'm really really trying to avoid butchering the config files with various text processing tools. Regards, Graham --
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
