[augeas-devel] Path and increasing identifiers

Raphaël Pinson raphink at gmail.com
Wed Dec 16 14:39:40 UTC 2009


On Wed, Dec 16, 2009 at 3:28 PM, Tim Stoop <tim.stoop at gmail.com> wrote:
> Hi all,
>
> I'm trying to knit some of our puppet recipes together with Augeas,
> because I think the Augeas way of working is much nicer than sourcing
> files. However, I'm running into one thing I can't seem to solve: Take
> the /etc/hosts file, every entry has a unique identifier (like
> /files/etc/hosts/1/), how do I determine which one is the highest, so
> I can automatically do something like last()+1 for a new IP address?
>

last()+1 is exactly it :-)
e.g. augtool print '/files/etc/hosts/*[last()]'


And your can use last()+1 in your insert command.


Raphaël



> --
> Gegroet,
> Tim
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>




More information about the augeas-devel mailing list