Shell Program to create a RPM name


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Program to create a RPM name
# 1  
Old 08-05-2009
CPU & Memory 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 :P
SmilieSmilie

Last edited by anand.linux1984; 08-05-2009 at 10:41 AM..
# 2  
Old 08-05-2009
Code:
$ 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.
# 3  
Old 08-06-2009
Thanks aigles. Worked like a chmp. SmilieSmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

How to create an rpm from installed files?

i would like to package up an rpm from pre-installed files, say i have a program called "widget" installed under "/opt/widget" /opt/widget/bin/* /opt/widget/lib/* /opt/widget/etc/* /opt/widget/log/* and i want to create an rpm from those already installed files, what would the spec file... (2 Replies)
Discussion started by: melixir
2 Replies

2. UNIX for Advanced & Expert Users

Figure out what rpm package a program is a part of

I am trying to figure out what rpm package a program is a part of. I have tried the normal way. rpm -qa | grep -i programname What other ways can you try? (3 Replies)
Discussion started by: cokedude
3 Replies

3. UNIX for Dummies Questions & Answers

How to create rpm?

I m referring below article for creating rpm. Installation and Setup Rpmbuild Tutorial As per the document i will need rpmdevtools and rpmlint to begin with. However i have yum installed and whenever i run them i get below output. # yum install rpmdevtools rpmlint Setting up Install Process... (0 Replies)
Discussion started by: pinga123
0 Replies

4. Programming

How to create RPM in RHEL5

I would like to package my developed application and deploy it using RPM to my users. Understand that RHEL5 has the following directories created: /usr/src/redhat/BUILD /usr/src/redhat/RPMS /usr/src/redhat/SOURCES /usr/src/redhat/SPECS /usr/src/redhat/SRPMS Using KDevelop as my... (0 Replies)
Discussion started by: tanlccc
0 Replies

5. Red Hat

How to create RPM in RHEL5

I would like to package my developed application and deploy it using RPM to my users. Understand that RHEL5 has the following directories created: /usr/src/redhat/BUILD /usr/src/redhat/RPMS /usr/src/redhat/SOURCES /usr/src/redhat/SPECS /usr/src/redhat/SRPMS Using KDevelop as my... (0 Replies)
Discussion started by: tanlccc
0 Replies

6. UNIX for Dummies Questions & Answers

How to create rpm from tar.gz?

I m planning to use puppet to implement organizational linux hardening policies across the linux servers. To begin with i have downloaded. puppet-2.7.1.tar.gz and tried some basic configuration to get start with puppet. Now i want to roll out the puppet but before that i would like to make... (7 Replies)
Discussion started by: pinga123
7 Replies

7. Shell Programming and Scripting

How to make RPM not write to RPM database if RPM fails to deploy?

How to make RPM not write to RPM database if RPM fails to deploy? IE I create an rpm spec file that contains the following if then exit 1 fi My rpm will fail at deployment, but if I do rpm -qa , I can see the rpm in the rpm db (3 Replies)
Discussion started by: 3junior
3 Replies

8. Shell Programming and Scripting

Write an automated shell program(s) that can create, monitor the log files and report the issues for

Hi , Please help me getting this done. Write an automated shell program(s) that can create, monitor the log files and report the issues for matching pattern. (i) Conditions for creating log files. Log file is created with date (example 2010_03_27.log). If the log file size is 10 Mb for... (1 Reply)
Discussion started by: itian2010
1 Replies

9. Red Hat

If I want to create such Installer (Not RPM)

Hi All, I had created a installer (RPM), but later I came across that Netbeans (netbeans-6.9-ml-linux), Flex Builder Linux Alpha (flexbuilder_linux_install_a4_081408.bin) and JDK (jdk-6u20-linux-i586-rpm.bin) dont provide any RPM but they provide a huge binary executable shell script. My... (0 Replies)
Discussion started by: jw_amp
0 Replies

10. Programming

Create a lib from a c program

I have a function in a c program that I want to to share with other programs. How do I create a lib using the cc compiler ? (9 Replies)
Discussion started by: npires
9 Replies
Login or Register to Ask a Question