I am looking for a structured format of version info for OS-level executables, such as in /usr/bin and /usr/local/bin. The problem we are having is the inconsistent architecture between our PROD and TEST environments and we are finding that many executables in our lower environments have had patches applied whereas PROD has not, which invalidates a lot of testing -- stuff works in TEST but doesn't in PROD because of such system discrepancies.
So I would like to run a system assurance check to list all executables and get the version number but nothing else and then produce deltas. Some commands don't support the -version option but even those that do display very verbose, free-text format of a version narrative and the version number is buried somewhere within, with no way to extract it programmatically.
Alternatively, I was thinking to run a file-level cksum for every executable as an option of last resort but I was hoping that there would be a way to extract version info relevant fields programmatically.
Thanks

/usr/foo11.5/utilprogram -versionin one environment will be 11.5, in another will be 11.5.1 because they applied a patch and that breaks everything. but both envs'utilprogramis in the same dir (/usr/foo11.5) so from a distance they look like they should be the same. the checksums are different. – amphibient Dec 20 '12 at 21:39