in reply to Re: Oneliner replace in-place adds extra spaces at the end of the file
in thread Oneliner replace in-place adds extra spaces at the end of the file

Great, thanks, also noting comments from ikegami.

My use-case is part of a bigger setting whereas I find it convenient/simpler/fool-proof to slurp the whole file (tiny file sizes). So, I will not use -l but will use -0777. And I will use -p not because of its loop around the chunks being slurp at the tiem but because of its final print.

Replies are listed 'Best First'.
Re^3: Oneliner replace in-place adds extra spaces at the end of the file
by ysth (Canon) on Oct 29, 2025 at 18:50 UTC
    Do note that 0777 does not slurp all input, just until EOF; with multiple input files it loops over them, one chunk per file.

      Oh OK