Re: Sed and redirection into the same file

"Joshua Bassett" <[email protected]> Sat, 30 Sep 2006 14:18:03 +1000
Newsgroups gmane.org.user-groups.mlug.main
Message-ID <[email protected]>
Thanks Chris. I'm glad I can do it with sed because perl kinda seems
like overkill for what I wanted to do :) Sed is one of those tools I
know I should use more often.

On 9/30/06, Christian Lerrahn <[email protected]> wrote:
> Hi Brendon,
> hi Joshua,
> > You can't do in-place file edits with sed.  Stick with what you found
> > to work and just rename the .new file if it's non-zero in size
> > otherwise delete it. e.g:
>
> Wrong. This is from "man sed" and I've used it before
>
> "       -i[SUFFIX], --in-place[=SUFFIX]
>
>               edit files in place (makes backup if extension supplied)"
>
> Works exactly like "perl -pi".
>
> Cheers,
> Christian
>
> _______________________________________________
> Melbourne Linux Users Group (Australia)
> MLUG Web Site: http://www.mlug.org.au/
> Edit your settings: http://lists.mlug.org.au
>