Set KM Variable From Awk Output

Hello, I have a script that parses data from a xml file that passes that parsed data to an awk sum command and gives me an accurate result. I want to now take that result and set it as a KM variable. I see I can get variables INTO awk, but don't see any documentation on setting a variable FROM awk. Is this possible?

Here's the script I can run in terminal:

xmlstarlet select --template --value-of '//@dur' /Users/hiltr0n/Desktop/test.xml | awk '{sum+=$0} END{print sum}'

result is a number that I want to set as a variable to then use in keyboard maestro

Pop your command line into an Execute Shell Script action and set the action's popup to save results to variable and add the variable name to the action. Should look like this:

I tried that, but it isn't setting the awk sum result into a variable. I must be missing something. Here's the test xml I'm working with
TEST.xml.zip (1.3 KB)
If xmlstarlet is installed, it works just fine in terminal.

See this recent discussion about mirroring your shell environment in Keyboard Maestro.

Yep, as in how to setup the shell environment in KM. See Execute a Shell Script action.