[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed
From: |
Stepan Kasal |
Subject: |
Re: sed |
Date: |
Thu, 30 Dec 2004 11:30:14 +0100 |
User-agent: |
Mutt/1.4.1i |
Hello,
On Wed, Dec 29, 2004 at 11:49:58PM -0800, srinivas murthy wrote:
> How can work the following scenario:
>
> assuming the test below:
> This is onetext that needs
> to be one file that need not
> be deleted oneanother.
>
>
> Now I want to replace the "one" with "two"
> if I use
> sed -e s/one/two/g
> it will replace even "oneanother" to "twoanother"
>
> I want to replace only words "one" with "two"( means
> exact macth of one)
>
> Hope I am clear .
Perhaps the comp.unix.shell newsgroup is better suited for these questions.
sed 's/\<one\>/two/g' could work woth GNU sed.
HTH,
Stepan Kasal
- sed, srinivas murthy, 2004/12/30