Re: [PATCH] Warnings before rebasing -i published history
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:54:00
konglu@minatec.inpg.fr writes:
The fact is that the input of sed is "$1" itself. An redirecting the output of sed to the same input doesn't seem to work.
No, reading and writing to the same file usually doesn't work (unless you have a very good reason to do it). But using printf seems weird. It just forces the shell to hold the whole output of sed in memory to be able to pass it to printf. Isn't a more conventional way to do that sed -e '...' "$1" >"$1".new mv "$1".new "$1" ? -- Matthieu Moy http://www-verimag.imag.fr/~moy/