You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
last() does not resolve when used inside following-sibling or preceding-sibling.(it effectively resolves to 1 I believe in this case)
augtool print /files/etc/pam.d/password-auth/"*[type='auth'][following-sibling::*[type='auth'][last()]]" != augtool print /files/etc/pam.d/password-auth/"*[type='auth'][following-sibling::*[type='auth'][6]]" (if 6 is your last item in password-auth's auth section)
I'd submit a PR for it but alas I only write Ruby and Java...
The text was updated successfully, but these errors were encountered:
I don't follow what this path expression is trying to do. Here's some explanation on what it says:
/files/etc/pam.d/password-auth/*[type='auth'] are all nodes (~ lines IIRC) in password-auth who have a type child with value auth
adding [following-sibling::*[type='auth'][last()]] to that keeps only those nodes who have a sibling later on that also has a type child with value auth; the [last()] there doesn't really do anything -if we have any matching following siblings [last()] will always match
adding [following-sibling::*[type='auth'][6]] to the first expression keeps those nodes who have 6 or more following siblings with a type child with value auth
which roughly says "Of all the type=auth nodes give me the last one that has a following type=auth sibling"; IOW, "Give me the last-but-one type=auth node" which could be written more concisely as
last() does not resolve when used inside following-sibling or preceding-sibling.(it effectively resolves to 1 I believe in this case)
augtool print /files/etc/pam.d/password-auth/"*[type='auth'][following-sibling::*[type='auth'][last()]]"
!=augtool print /files/etc/pam.d/password-auth/"*[type='auth'][following-sibling::*[type='auth'][6]]"
(if 6 is your last item in password-auth's auth section)I'd submit a PR for it but alas I only write Ruby and Java...
The text was updated successfully, but these errors were encountered: