Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to check the version of Firefox through Apple Remote Desktop of all managed computers. I have written this, but it only checks for Firefox in /Applications

/bin/cat /Applications/Firefox.app/Contents/Info.plist | grep -A 1 CFBundleShortVersionString | grep string | sed 's/[/]//' | sed 's/<string>//g'

For standard users Firefox auto update breaks if it is in /Applications so I instead have it installed in ~/Applications

I'd like to check that copy (if it exists), but I can't specify the path in the command since it is unique to each computer. For example:

/Users/jon/Applications/Firefox.app

/Users/arya/Applications/Firefox.app

Presumably I want to use find and pipe the result to my command. This should work for 10.6 through 10.8

share|improve this question
add comment

2 Answers

locate Firefox.app |grep "Firefox.app$"

should give you the exact location(s)

share|improve this answer
    
locate on OS X is uninitialized by default. –  Daniel Beck Jul 2 '13 at 20:13
add comment

One way to do this would be to us a shell script to get the list of user folders in /Users, and look through those in a loop. Something like:

for i in $(ls /Users/ | grep -v Shared | grep -v Deleted)
do
    grep -A 1 CFBundleShortVersionString /Users/${i}/Applications/Firefox.app/Contents/Info.plist | grep -A 1 CFBundleShortVersionString | grep string | sed 's/[/]//' | sed 's/<string>//g'
done
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.