Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2007 11:24:57 -0700 (PDT)
From:      youshi10@u.washington.edu
To:        questions@freebsd.org
Subject:   Re: problem with sed substitution
Message-ID:  <Pine.LNX.4.43.0706191124570.5830@hymn01.u.washington.edu>
In-Reply-To: <46780B29.7000004@oregnier.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 19 Jun 2007, Olivier Regnier wrote:

> Hi everyone,
>
> I try to use sed with /etc/gettytab file. I would like to replace this text :
> \r\n%s\%m ($h) (%t)\r\n\r by Hello world.
> I tested with this command :
> % sed -i.old -e 's/\r\n%s\%m ($h) (%t)\r\n\r/Hello world/'
> but that doesn't work at all.
> Can you help me please ?
>
> Thank you :)

In place replacement isn't a wise idea. Output it to a temp file, then move it to the old filename if you wish.

-Garrett




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.43.0706191124570.5830>