extracting rpm list from a file
Hi
I have a file containing the list of rpms as below:
I would like to extract the rpm ( excluding the version details)
My problem is if the list simply contained rpms like
4Suite-1.0-3
acl-2.2.23-5
alchemist-1.0.34-1
anacron-2.3-32
apmd-3.0.2-24
automake14-1.4p6-12
automake15-1.5-13
automake16-1.6.3-5
automake17-1.7.9-5
elfutils-libelf-0.97-5
emacs-common-21.3-19.EL
fonts-xorg-base-6.8.1-1
and so on... If it contained the entries only like
4Suite-1.0-3
acl-2.2.23-5
alchemist-1.0.34-1,
then it would not have been a problem as i can grep the first field using - as a delimiter. But here as it has other entries like
automake17-1.7.9-5
elfutils-libelf-0.97-5
emacs-common-21.3-19.EL
fonts-xorg-base-6.8.1-1
It is not possible to do so. ( In the case of automake17-1.7.9-5), I simply need the output as automake.
How do I do it ? Your help will be highly appreciated
Thank you
|