Extension script problem

cwaldrip
Valued Contributor

I've written an extension to basically grep the number from the name of a text file we used in our old imaging method to keep track of the image version installed on machines.

The file is /Restore/ Image Version 6.5.3.txt (Note the space at the beginning of the file, and we used RTF at one point in time and switched to TXT).

The script works on it's own, but no results are returned from the extension. the script is...

#!/bin/bash
Filename=`ls /Restore/ Im*`
        if [ -z "$Filename" ]; then
                Bar="N/A"
        else
                Foo=${Filename#/Restore/ Image Version }
                Bar=${Foo%.*}
        fi
echo $Bar

The data type is set to string, the inventory display is set to Extension attributes.

Is there a place to look and see the results of extensions so I can see what the problem is?

1 ACCEPTED SOLUTION

rlandgraf
Contributor

You need to echo the results with echo "<result>$Bar</result>" in order for it to show up in extension attributes.

View solution in original post

2 REPLIES 2

rlandgraf
Contributor

You need to echo the results with echo "<result>$Bar</result>" in order for it to show up in extension attributes.

cwaldrip
Valued Contributor

Yep. That was it. D'oh! :-)