<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Sorry for the very late reply ...<br><br>On Fri, Aug 28, 2015 at 5:24 AM, Mol, Xavier (SCC) <span dir="ltr"><<a href="mailto:xavier.mol@kit.edu" target="_blank">xavier.mol@kit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi again,<br>
<br>
for some reason I cannot explain, now a couple of things work suddenly as expected:<br>
<br>
augtool> match $master/*[last()]<br>
/files/etc/auto.master/3 = +<br>
augtool> match $master/*[position() = 2]<br>
<span class="">/files/etc/auto.master/#comment[1] = Sample auto.master file<br>
</span><span class="">augtool> match $master/*[label() != '#comment'][last()]<br>
/files/etc/auto.master/3 = +<br>
<br>
<br>
</span>Though not everything does...<br>
<span class=""><br>
augtool> match $master/*[label() != '#comment']<br>
/files/etc/auto.master/1 = /misc<br>
/files/etc/auto.master/2 = /net<br>
/files/etc/auto.master/3 = +<br>
</span><span class="">augtool> match $master/*[label() != '#comment'][position() = 2]<br>
  (no matches)</span><br></blockquote><div><br></div><div>This is a bona fide bug - "match <span class="">$master/*[label() != '#comment'][2]" </span>should absolutely return the $master/2 node.<br><br></div><div>What's going wrong is that the tree has a bunch of 'hidden' nodes (nodes whose label is NULL); they weren't being suppressed properly during the match; in that last match, we actually matched such a hidden node, but when Augeas goes to print the result it acts as if there was no node (hence the name 'hidden')<br><br></div><div>I've put up <a href="https://github.com/hercules-team/augeas/pull/323">https://github.com/hercules-team/augeas/pull/323</a> that fixes that issue.<br><br></div><div>David<br></div></div></div></div>