Re: Use m4 to change a file in-place

"Jack J. Woehr" <[email protected]> Sun, 10 Apr 2016 12:32:52 -0600
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>
cp keeps the file mode of the target unless you use the -p switch.

Peng Yu wrote:
>
>
> On Sunday, April 10, 2016, Jack J. Woehr <[email protected] <mailto:[email protected]>> wrote:
>
>     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.
>
>     No, but you can use the Linux mktemp command and pipe to the temp file then copy it back.
>
>
> This does not maintain file mode.
>
>
>     -- 
>     Jack J. Woehr     # Science is more than a body of knowledge. It's a way of
>     www.well.com/~jax <http://www.well.com/%7Ejax> # thinking, a way of skeptically interrogating the universe
>     www.softwoehr.com <http://www.softwoehr.com> # with a fine understanding of human fallibility. - Carl Sagan
>
>
>
> -- 
> Regards,
> Peng


-- 
Jack J. Woehr     # Science is more than a body of knowledge. It's a way of
www.well.com/~jax # thinking, a way of skeptically interrogating the universe
www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan