Bash script to compare 2 file

Hello Friends

please help me to create script to compare 2 fiile which has rpm info .

File 1:

glibc-2.12.1.149.el6_6.5.x86_64.rpm
glibc-common-2.12-1.149.el6_6.5.x86_64.rpm

File 2 :

glibc-2.12.123.el6_6.5.x86_64.rpm
glibc-common-2.12-123.el6_6.5.x86_64.rpm

To compare file1 data is grater then file2 or not.
please help.

Thanks in advance .!

Hi.

On a system:

OS, ker|rel, machine: Linux, 2.6.32-358.23.2.el6.centos.plus.x86_64, x86_64
Distribution        : CentOS 6.4 (Final)

In package: rpmdevtools.noarch there is a code rpmdev-vercmp RPM version comparison checker which looks useful. (A result from How to programmatically determine the highest version kernel RPM installed? - Unix & Linux Stack Exchange as the first hit in a Google search compare versions of rpm files)

Best wishes ... cheers, drl

1 Like