Big Sur and Xpatch changes

Tomik_UNO
New Contributor II

Hello all

Does anyone of you already noticed this "tiny" change in Xpath syntax causing a problems with existing scripts (codes)?
As described in this ARTICLE the change is related to the version of Pearl running in Big Sur.

Old syntax seems to look like:
[5.18] xpath [filename] query

And new one (Big Sur) should look like:
[5.28] xpath [options] -e query [-e query...] [filename...]

This is huge change if you are using Xpath a lot in JAMF scripts, etc.

I'm wondering how you were/are dealing with it. Or if you are using alternatives for xpath.

2 REPLIES 2

mm2270
Legendary Contributor II

I read about this a couple of weeks back, on that same blog by Armin Briegel. This is something a lot of us are going to need to work out. Based on what Armin writes on his blog post, you will need a function or some kind of if/then/else block that determines the OS version and runs the appropriate xpath command. The new syntax is not backward compatible with pre Big Sur OSes, so if you have a mixed OS environment, you'll have to have that check in place. But I guess once you work it out once it's easily portable to other scripts and then it's done for the time being.

dan-snelson
Valued Contributor II

@Tomik_UNO The following SQL queries may prove helpful to determine which scripts and / or Extension Attributes you need to review / update:

Scripts

SELECT script_id,file_name FROM scripts WHERE script_contents LIKE '%xpath%';


Extension Attributes

SELECT extension_attribute_id,display_name FROM extension_attributes WHERE script_contents_mac LIKE '%xpath%';


--
Dan