Closed git-bruh closed 2 years ago
It's impossible to use sed -i in portable way. Some implementations require extension argument, some don't, some don't implement this option at all.
The current solution (sed file >_; mv _ file
) works with every implementation, and doesn't require any new tools. There's no reason to stop using it. This is just for build scripts, it's ok to have one extra line for the sake of simplicity and portability.
I'd rather ship a posix-compliant
ed
(i.e. one that supports regex, which busybox does not) and use that.