Shell Program to create a RPM name

Hi Guru,s/Geek,s

I need help to create RPM names from rpms.

Example :

a2ps-4.14-6.fc10.i386
perl-Email-Find-0.10-2.fc10.noarch
directfb-1.2.7-2.fc10.i386
libid3tag-0.15.1b-7.fc10.i386
apr-util-1.3.7-1.fc10.i386
libquicktime-1.0.3-4.fc10.i386

The Desired Output is :

a2ps
perl-Email-Find
directfb
libid3tag
apr-util
libquicktime

The characters from package version in a line should be removed in order to get the rpm name. I need the rpm names to do a yum.

Please help :stuck_out_tongue:
:(:b:

$ cat inputfile
perl-Email-Find-0.10-2.fc10.noarch
directfb-1.2.7-2.fc10.i386
libid3tag-0.15.1b-7.fc10.i386
apr-util-1.3.7-1.fc10.i386
libquicktime-1.0.3-4.fc10.i386A
$ sed 's/-[0-9].*//' inputfile
a2ps
perl-Email-Find
directfb
libid3tag
apr-util
libquicktime
$

Jean-Pierre.

Thanks aigles. Worked like a chmp. :b::b::b: