[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: sed




> -----Original Message-----
> From: behapy [mailto:behapy@myrealbox.com]
> Sent: Friday, January 24, 2003 4:04 AM
> To: debian-user@lists.debian.org
> Subject: sed
>
>
> Hi?
>
> kdjwiskjkdf+-www.kde.org+-333.kjkd.html
> kdjfwiwji+-kbs.co.kr+-cgi-bin+-kkk.cgi
> kdjfwiwji+-kbs.co.kr+-cgi-bin+-kk2.cgi
>
> =>
>
> www.kde.org+-333.kjkd.html
> kbs.co.kr+-cgi-bin+-kkk.cgi
> kbs.co.kr+-cgi-bin+-kk2.cgi
>
> I'd like to remove the first words everyliles ~+-
>
> sed -e 's/^*+-//g' SOMEFILE.TXT don't work.
> How do I do?


Try sed -e 's/^[^+]+\+-//'

In english: Line starts with one or more not-pluses, followed by plus and
minus. Since there is only one word to remove, using /g is probably not what
you want. In addition '/^*'  is meaningless: your asking for zero or more
occurances of the start of a line.

> Thanks,
> GGG
> NI	Šujzざ¶n˘뒼y~문Nn˘r께뼮



Reply to: