Sponsored Content
Top Forums Shell Programming and Scripting To delete the common parts (version and suffix) to get the package name Post 302874165 by yanglei_fage on Thursday 14th of November 2013 10:47:16 AM
Old 11-14-2013
To delete the common parts (version and suffix) to get the package name

I have lots of package version +suffix full name, but I just want to get the package name, which means delete the common parts

eg:

Code:
dtc-1.3.0+gitAUTOINC+033089f29099bdfd5c2d6986cdb9fd07b16cfde0-r4.1.x86_64.rpm            dtc-dev-1.3.0+gitAUTOINC+033089f29099bdfd5c2d6986cdb9fd07b16cfde0-r4.1.x86_64.rpm        dtc-staticdev-1.3.0+gitAUTOINC+033089f29099bdfd5c2d6986cdb9fd07b16cfde0-r4.1.x86_64.rpm
dtc-dbg-1.3.0+gitAUTOINC+033089f29099bdfd5c2d6986cdb9fd07b16cfde0-r4.1.x86_64.rpm        dtc-misc-1.3.0+gitAUTOINC+033089f29099bdfd5c2d6986cdb9fd07b16cfde0-r4.1.x86_64.rpm

out put

Code:
dtc
dtc-dev
dtc-static-dev
dtc-misc

another example is:

Code:
openvswitch-1.10.0-r4.atom_intel.rpm             openvswitch-dbg-1.10.0-r4.atom_intel.rpm         openvswitch-doc-1.10.0-r4.atom_intel.rpm         openvswitch-switch-1.10.0-r4.atom_intel.rpm openvswitch-controller-1.10.0-r4.atom_intel.rpm  openvswitch-dev-1.10.0-r4.atom_intel.rpm         openvswitch-pki-1.10.0-r4.atom_intel.rpm         openvswitch-testing-1.10.0-r4.atom_intel.rpm

to get
Code:

openvswitch
openvswitch-dpg
openvswitch-doc
openvswitch-dev
openvswitch-pki
openvswitch-testing
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Most common version of UNIX on production systems

I am new to UNIX (about a year) and learning as fast as I can. I am an instructor teaching UNIX and have two labs with Ultra 10 333 MHz, Sun Blade 1000 1 GHz, Blade 100, and Two Enterprise 250 Servers. We are currently teaching our classes using the Solaris 2.10 OS, downloaded in May 2006, I am not... (7 Replies)
Discussion started by: dutchman
7 Replies

2. UNIX for Dummies Questions & Answers

How to rename multiple files with a common suffix

Hi, There are multiple files like file1_11 file2_11 file3_11.....and so on. How to rename them such tht the suffix _11 is removed and they become file1, file2, file3. Any help is appreciated. Regards er_ashu (1 Reply)
Discussion started by: er_ashu
1 Replies

3. UNIX for Dummies Questions & Answers

package version

hi, I have this problem. I run a script to check which version of a given package is installed and I need something returning a meaningfull answer also if the installation was done with the sources. Let's say that, a priori, I do not know how the package was installed. So far I have... (0 Replies)
Discussion started by: gcastell
0 Replies

4. Shell Programming and Scripting

Delete parts of a string of character in one given column of a tab delimited file

I would like to remove characters from column 7 so that from an input file looking like this: >HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD I get something like that in an output file: ... (13 Replies)
Discussion started by: matlavmac
13 Replies

5. Debian

Package updated to same version

Hi, I recently did slight modifications to the basename utility from the coreutils package. I downloaded the source by typing "apt-get source coreutils", added a new option to the program, updated the respective manpage, build and installed it using "dpkg-buildpackage -uc -b && dpkg -i... (0 Replies)
Discussion started by: Gunther
0 Replies

6. Shell Programming and Scripting

Package version testing script

I was wondering if anyone already had a script to check rpm packages versions x.x.x or greater. so I could do a: # CheckRpmVersion Somepackage-1.2.3 And would output: whether the package is installed or not and if it was equal to or greater than the version 1.2.3. I know I can pull out... (0 Replies)
Discussion started by: Ikon
0 Replies

7. Shell Programming and Scripting

Remove version numbers from package lists

I just upgraded my laptop from Fedora 13 to 14, and normally, before I do the upgrade (Fresh install) I run an rpm command to make a list of all the packages I have installed, but without the version and architectures specified, so that I can just feed that list to yum after the upgrade to... (2 Replies)
Discussion started by: Tsuroerusu
2 Replies

8. Shell Programming and Scripting

Delete specific parts in a .txt file

Hi all, I desperately need a small script which deletes everything in a particular .txt file when "Abs = {" appears till "},", and also when "B-1 = {" appears till "}," I would like all the text in between of those instances to be deleted, however, other text to be unedited (kept as it is).... (12 Replies)
Discussion started by: c_lady
12 Replies

9. Solaris

Check that supersede of package version is installed

I need a programmatic way to check, that supersede of required package is installed. At Linux I do it using rpmvercm utility to compare installed package version to my minimal requirement. So - I need analog of Linux "rpmvercm" utility for Solaris (10/11) Let us say - I know that minimal version... (10 Replies)
Discussion started by: zuismanm
10 Replies

10. UNIX for Beginners Questions & Answers

How to install older package version on Ubuntu 18.04?

Hello, I'm running Ubuntu 18.04 and I would like to install libboost-python version 1.46. Currently I have installed version 1.65: wakatana@local-machine:~$ dpkg -l | grep libboost-python ii libboost-python-dev 1.65.1.0ubuntu1 amd64 ... (1 Reply)
Discussion started by: wakatana
1 Replies
nameserv::common(n)					       Name service facility					       nameserv::common(n)

__________________________________________________________________________________________________________________________________________________

NAME
nameserv::common - Name service facility, shared definitions SYNOPSIS
package require Tcl 8 package require nameserv::common ?0.1? ::nameserv::common::port _________________________________________________________________ DESCRIPTION
Please read Name service facility, introduction first. This package is internal and of no interest to users. It provides the commands of the name service facility which are shared by the client and server implemented by the packages nameserv::server and nameserv (the client). This service is built in top of and for the package comm. It has nothing to do with the Internet's Domain Name System. If the reader is looking for a package dealing with that please see Tcllib's packages dns and resolv. API
The package exports a single command, as specified below: ::nameserv::common::port The result returned by the command is the id of the default TCP/IP port a nameservice server will listen on, and a name service client will try to connect to. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category nameserv of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
nameserv::client(n), nameserv::server(n) KEYWORDS
client, name service, server COPYRIGHT
Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net> nns 0.1 nameserv::common(n)
All times are GMT -4. The time now is 04:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy