1 |
Pandu Poluan <pandu@××××××.info> wrote: |
2 |
|
3 |
> On Tue, Nov 22, 2011 at 10:26, Adam Carter <adamcarter3@×××××.com> wrote: |
4 |
> >>> sed -r -e 's/(.*)-[0-9].*/\1/' |
5 |
> >> |
6 |
> >> You know, that looks familiar... are you trying to get a package name from |
7 |
> >> the list of eix-installed? :-) |
8 |
> > |
9 |
> > No - its non-gentoo. In this case it hasn't worked |
10 |
> > |
11 |
> > $ echo net-snmp-5.3.2.2-5.cp843034001.i386.rpm | sed -r -e 's/(.*)-[0-9].*/\1/' |
12 |
> > net-snmp-5.3.2.2 |
13 |
> > |
14 |
> |
15 |
> Ah, yes. sed's greedy regex again messes up the plan >.< |
16 |
> |
17 |
> Here's an alternative: |
18 |
> |
19 |
> sed -r -e 's/-[0-9].*//' |
20 |
|
21 |
Nust a note: sed has no option -r and 's/(.*)-[0-9].*/\1/' is a "garbled" |
22 |
command. A corrected version would be 's/\(.*\)-[0-9].*/\1/' |
23 |
|
24 |
So the main question is: why do you use a non-existing option? |
25 |
|
26 |
Jörg |
27 |
|
28 |
-- |
29 |
EMail:joerg@××××××××××××××××××××××××.de (home) Jörg Schilling D-13353 Berlin |
30 |
js@××××××××××××.de (uni) |
31 |
joerg.schilling@××××××××××××××××.de (work) Blog: http://schily.blogspot.com/ |
32 |
URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily |