On Tue, 26 Mar 2002, Alan Wilter Sousa da Silva wrote:

>
> Hi List, I swear I tried, but how can I make a whole line substitution
> using 'sed'? I mean I have a 'word', then I want to find the 'line' where
> 'word' is and so change this whole 'line' by a 'phrase'.  All that I got
> with 'sed' by now is change 'word' by another 'word'.
>
> I'd appreciate very much any attention.

Arggghhh, this may be clearer:
 sed -e 's/^.*old_word.*$/new text/' filename

This looks for an entire line rather than just a phrase by specifying
the start and end anchors. This way, everything on the line is seen as a
match.


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to