Finding version of firefox in directory

I have a unique situation, I have a RHEL OS but also a file path that has a OS image (it is not the image running on the machine) if I run fire fox -version it will give me the version of the actively installed FF however I need to know if the version of FF sitting in the non active path is the same version of the one installed. Any ideas?

I suppose with hindsight you could have installed them in appropriate directories with the version number as part of the path, but if the firefox executable has to be in your PATH, try changing your PATH to the required 'inactive' directory and running the same. Does that help?

Alternatively, you might be able to force the command like this:-

/path/to/unknown/firefox -version

Does that help?

Robin

I took this responsibility from someone else because we don't think it was being mirrored correctly. Maybe some more details will help. I have a machine that I install updates or new applications and test to ensure it is secure and the software still works. Whenever I have the thumbs up to move it over to the other network, I make a tarball of the not active OS path and untar the overlay of the OS to the new machine on the other network. So that it can be tested with out software.

I know I could just take this over add the overlay of the OS and then do -version however, I have restrictions on what I can and cannot take over there without proper authority. Is there a file that I can look into to see version numbers? I did find compatibility.ini but that only tells me last version compatible.

Hi,

This is a bit of an oddball suggestion to say the least, but if you have a full proper install of Firefox that came from a package or repo somewhere, you might well have the changelog to look at. For example, on my own system (which is admittedly Ubuntu rather than RHEL/CentOS, but it's the only box I have Firefox installed on) I could do something like this:

zcat /usr/share/doc/firefox/changelog.Debian.gz | head -1 | awk '{print $2}' | sed s/[\(\)]//g

which returns:

51.0.1+build2-0ubuntu0.16.04.2

So if you have the changelog, you can look at the first line and strip out the version number, basically.

Other than that, if it was installed from a package you could query the rpm database directly, but since it seems you only have access to the files and not a running copy of the other OS build that might not be feasible. If it was installed properly via yum/rpm in the other OS though you could look at the yum.log or something similar, and strip out the version number that way maybe.

Interesting suggestion. awk is a lot more functional than cut fyi, you can replace all the kitchen | sink | commands with one awk.

zcat file.gz | awk '{ gsub(/[\(\)]/, ""); print $2 ; exit }'
1 Like