Hello everyone,
some of our users use a software called openLCA. As we had some issues with new versions in the past we distribute updates the way the last version stays. So in general they have two versions of this App on their systems.
But my EA only finds (and reports) the wirst version. Can someone tell what is wrong with my code?
Thanks.
#!/bin/sh
##########################################################################
# A script to collect the Bundle Version of openLCA. #
##########################################################################
PATH_EXPR="/Applications/*/Contents/MacOS/eclipse"
BUNDLE_ID="openLCA"
KEY="CFBundleShortVersionString"
RESULTS=()
IFS=$'\\n'
for BINARY in ${PATH_EXPR}; do
PLIST="$(/usr/bin/dirname "${BINARY}")/../Info.plist"
if [ "$(/usr/bin/defaults read "${PLIST}" CFBundleName 2>/dev/null)" == "${BUNDLE_ID}" ]; then
RESULTS+=($(/usr/bin/defaults read "${PLIST}" "${KEY}" 2>/dev/null))
fi
done
unset IFS
if [ ${#RESULTS[@]} -eq 0 ]; then
/bin/echo "<result></result>"
else
IFS="|"
/bin/echo "<result>|${RESULTS}|</result>"
unset IFS
fi
exit 0