mm2270 / JamfProScripts

A collection of shell scripts created for use in Jamf Pro and elsewhere
MIT License
174 stars 30 forks source link

getJavaVersion has dangling \r #4

Open brunerd opened 9 years ago

brunerd commented 9 years ago

There's a \r at the end of currVersBase from the getJavaVersion, so the compare fails and will bug you in Self Service mode

Added a sed item to to kill \r: -e "s/"$'\r'"//g"

So it is now: currVersBase=$( curl -sfA "${UAGENT}" "${URL}" 2>/dev/null | awk -F'[>|<]' '/Version/{print}' | sed -e 's/Version //;s/ Update /./' -e "s/"$'\r'"//g")

mm2270 commented 9 years ago

Hi brunerd.

Thanks. I had seen that extra carriage return myself, and, at one point had fixed it (with a perl snippet, but sed works just as well), but my bad, I forgot to add that update into the script posted here. I'll be sure to update it with the correct code.

I'm working on a new version of the script with more features so a lot of my focus has been on that script, which is probably why I forgot to add it in to this version. At least that's my story and I'm sticking to it :)