One of the attributes that I wrote last year was to gather the version of
Flash. Recently I noticed that it stopped working, and realized it was
because I made assumptions about Flash that were not good. I re-wrote the
attribute and realized I could use it for anything I wanted to grab version
information on. So, I tweaked the one line command for Firefox,
Silverlight, and Growl. Here is the full Flash script:
--- code ---
#!/bin/bash
# get the current version of the flash player plug in
flashVersion=`/bin/cat /Library/Internet Plug-Ins/Flash
Player.plugin/Contents/Info.plist | grep -A 1 -m 1
CFBundleShortVersionString | grep string | sed 's/[/]//' | sed
's/<string>//g'`
echo "<result>$flashVersion</result>"
exit 0
--- /code ---
So, taking that one line you can edit it out for whatever app you want:
Firefox: ffVersion=`/bin/cat /Applications/Firefox.app/Contents/Info.plist
| grep -A 1 -m 1 CFBundleShortVersionString | grep string | sed 's/[/]//' |
sed 's/<string>//g'`
Silverlight: silverlightVersion=`cat /Library/Internet
Plug-Ins/Silverlight.plugin/Contents/Info.plist | grep -m 1 3. | sed
's/[/]//' | sed 's/<string>//g' | awk '{ print $1 }'`
Growl: growlVersion=`/bin/cat
/Library/PreferencePanes/Growl.prefPane/Contents/Info.plist | grep -A 1 -m 1
CFBundleShortVersionString | grep string | sed 's/[/]//' | sed
's/<string>//g'`
(Notice on the Silverlight one I had to use the awk command. I was getting
a strange error if I didn't)
Anyway, I wanted to share this with everyone in case someone else could use
it.
Happy Caspering!
Steve Wood
Director of IT
swood at integer.com
The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475
