I run an rpm -qa and get output of all packages installed on a Linux server. Then on another server I have a list of all RPM packages available. I need to compare the rpm list to the 'all' list and get just that one match even though there are similar names.
Example (rpm -qa list):
glibc-2.6.3-1.44.3
Example (all RPM packages available):
glibc | 2.6.3 | 1.44.3
glibc-html | 2.3.1 | 1.44.2
What I need to match is just the glibc on the first line of the example but I get all the glibc packages because they contain glibc when doing a grep. I tried using something with the shell by just getting the length of the filename (glibc which is 5) in the rpm -qa list and comparing that with each filename in the "all" list and if the file is a length of 5 and then matches the name then I use it. It still isn't giving me the correct output though.
Is there an easier way to only match glibc and not all other glibc* packages?
Thanks!!
Example (rpm -qa list):
glibc-2.6.3-1.44.3
Example (all RPM packages available):
glibc | 2.6.3 | 1.44.3
glibc-html | 2.3.1 | 1.44.2
What I need to match is just the glibc on the first line of the example but I get all the glibc packages because they contain glibc when doing a grep. I tried using something with the shell by just getting the length of the filename (glibc which is 5) in the rpm -qa list and comparing that with each filename in the "all" list and if the file is a length of 5 and then matches the name then I use it. It still isn't giving me the correct output though.
Is there an easier way to only match glibc and not all other glibc* packages?
Thanks!!