Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2007 17:00:08 -0000
From:      "Barry Byrne" <barry.byrne@wbtsystems.com>
To:        "'Halid Faith'" <maslak@ihlas.net.tr>, <freebsd-questions@freebsd.org>
Subject:   RE: How to replace two strings in a file in the same time with sedcommand ?
Message-ID:  <01f401c83c17$48fffef0$c5010c0a@SUNYA>
In-Reply-To: <002801c83c11$cd434e70$dc96eed5@ihlasnetym>
References:  <002801c83c11$cd434e70$dc96eed5@ihlasnetym>

next in thread | previous in thread | raw e-mail | index | archive | help
 

> -----Original Message-----
> From: owner-freebsd-questions@freebsd.org 
> [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Halid Faith
> Sent: 11 December 2007 16:21

> I want to replace two or more strings in a file in the same 
> time with sed command.
> How do I that ?

Halid:

You haven't said exactly what you want to do, but something like this should
get you started.


sed 's/oldstring1/newstring1/g; s/oldstring2/newstring2/g' < infile >
outfile






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01f401c83c17$48fffef0$c5010c0a>