2 ms·
sed -i also has the less obvious advantage that it is atomic. (It writes to a temporary file, and then atomically renames it to the final location. Whereas if
by Ao7bei3s 9y ago
sed -i also has the less obvious advantage that it is atomic.
(It writes to a temporary file, and then atomically renames it to the final location. Whereas if sed expr src > dst is killed, dst may be corrupt. You'd need to handle temporary file management yourself if your script needs to be reliable.)