Re: Замена "вариативного" фрагмента строки.
- To: debian-russian@lists.debian.org
- Subject: Re: Замена "вариативного" фрагмента строки.
- From: Yuri Kozlov <yuray@komyakino.ru>
- Date: Mon, 31 May 2010 19:28:55 +0400
- Message-id: <20100531192855.0b35db18@keeper.home.local>
- In-reply-to: <20100531151339.GG25129@undertaker.arta.local>
- References: <hu0in1$sgh$1@dough.gmane.org> <20100531151339.GG25129@undertaker.arta.local>
В Mon, 31 May 2010 21:13:39 +0600
Sergey Korobitsin <undertaker@arta.kz> пишет:
> Nicholas ☫ → To debian-russian@lists.debian.org @ Mon, May 31, 2010
> 10:55 +0000
>
> > Как можно заменить все фрагменты, которые начинаются, например, на
> > "background-color:" и заканчиваются на ";" , на "xxx" ?
>
> cat file | sed -e '{ s/background-color:.*;/xxx/g }'
>
> Как-то так, не?
$echo "11111 background-color: #sdfdfdf; 44444444 background-color: black; 00000" | sed -e 's/background-color: .[^;]*;/xxx/g'
$11111 xxx 44444444 xxx 00000
--
Best Regards,
Yuri Kozlov
Reply to: