1 |
Pandu Poluan <pandu@××××××.info> wrote: |
2 |
|
3 |
> >> sed -r -e 's/-[0-9].*//' |
4 |
> > |
5 |
> > Nust a note: sed has no option -r and 's/(.*)-[0-9].*/\1/' is a "garbled" |
6 |
> > command. A corrected version would be 's/\(.*\)-[0-9].*/\1/' |
7 |
> > |
8 |
> > So the main question is: why do you use a non-existing option? |
9 |
> > |
10 |
> |
11 |
> # sed --help |
12 |
> |
13 |
> Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]... |
14 |
> |
15 |
> ----- >8 snip |
16 |
> |
17 |
> -r, --regexp-extended |
18 |
> use extended regular expressions in the script. |
19 |
> |
20 |
> ----- >8 snip |
21 |
|
22 |
You seem to miss the fact that you are using gsed instead of sed. |
23 |
|
24 |
using -r makes scripts non-portable. |
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 |