Re: cut
- From: Michael Tosch <eedmit@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Oct 2006 23:42:00 +0100
virus.clear.net.nz wrote:
If I have a listing of packages,
such as : -
XML-Parser-2.34.tbz2
bin86-0.16.17.tbz2
libxml2-2.6.26.tbz2 system-tools-backends-1.4.2.tbz2
I want to cut the version number from the listing, leaving only bin86, libxml2, etc.
I think that cutting a "-" followed by a {0-9} achieve this ??? but cut only allows for a single delimiter.
How to achieve this ?
This deletes from the last '-' until the end of the line:
sed 's/-[^-]*$//' file
--
Michael Tosch @ hp : com
.
- References:
- cut
- From: virus.clear.net.nz
- cut
- Prev by Date: Re: listing nondirectories
- Next by Date: Re: how to find which shell I am using currently
- Previous by thread: Re: cut
- Next by thread: Using the grep command to filter
- Index(es):
Relevant Pages
|