On Thu, 31 Oct 2024 18:13:50 -0000 (UTC), Jim Henderson wrote:

> With the number of groups you're dealing with having to remove, I would
> recommend using some tool that accepts xpath search queries and that can
> delete entries based on that.  'jq' may be able to do this as well from
> a command-line if you prefer that.

Don't know what I was thinking here; jq is for JSON formats, not XML.  
xmllint from xmllib2 would be the XML alternative.

For that use case, I would invert the "starts-with" query, so instead of:

/group-preferences/group[starts-with(@name,'novell')]

I would use:

/group-preferences/group[not(starts-with(@name,'novell'))]

That way the output generated removes the undesired group elements.

Search and replace is something I'd still do with just a text editor as 
the easiest option, though.

-- 
 Jim Henderson
 Please keep on-topic replies on the list so everyone benefits


_______________________________________________
Pan-users mailing list
Pan-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/pan-users

Reply via email to