Peng Yu wrote:
> Hi, sed has an option `--in-place` to allow the change to a file
> in-place. But I don't find a similar option in m4. Does anybody know
> there is a similar option that I can use for in-place modification of
> a file? Thanks.

There are many, many commands out there that would all need to be
changed if you want to modify each and every one of them for in place
editing.  Better to use a filter program to centralize the code.  Such
as 'sponge' from the moreutils package.  Then it will work with any
filter.

  http://joeyh.name/code/moreutils/

With 'sponge' you can do things like this:

  sed '...' file | grep '...' | sponge file

Bob

Reply via email to