I was initially attempting to do this in Java using the UserDefinedFileAttributeView class but it turns out that is only available on Windows computers (This is being run on OSX)
So I switched gears with the hope that retrieving the information via a script would be the simpler route but it seems to not be as straight forward as I expected.
How would one go about retrieving an Application file's version number (file attribute) using Bash?
I've already looked into stat
but that only returns the basic file information.
I also looked into xattr
but I couldn't get that to return the "Version" attribute.
Any pointers would be greatly appreciated!
Best Answer
If you want to get the Version of an Application, which is what's shown in the Finder Get Info dialog box, then use this:
This will show you the version information.
For more information see this answer.