version_line=$(/usr/libexec/PlistBuddy -c "Print:Bomgar-Version" "/Library/Documentation/B-Info.plist" 2>/dev/null)
if [ $? != 0 ]; then
echo "none"
else
echo $version_line
fi
exit 0
I have this but my issue is the .app file has a diffrent name for each mac.
Its the Bomgar.app but the name has a ID tied into it example bomgar-scc-1234567-123456.app
How can I use the above code to look at the plist file inside the contents of this .app file.
example code
version_line=$(/usr/libexec/PlistBuddy -c "Print:CFBundleGetInfoString" "/Users/Shared/bomgar-scc-1234567-123456.app/Contents/Info.plist" 2>/dev/null)
if [ $? != 0 ]; then
echo "none"
else
echo $version_line
fi
exit 0