problem with sed substitution

youshi10 at u.washington.edu youshi10 at u.washington.edu
Tue Jun 19 18:24:58 UTC 2007


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



More information about the freebsd-questions mailing list