4 ms·
As a sidenote, if you're using a command that doesn't have -i, or a chain of commands where the file is read at the start and written at the end, you can use sp
by icebraining 9y ago
As a sidenote, if you're using a command that doesn't have -i, or a chain of commands where the file is read at the start and written at the end, you can use sponge(1) from moreutils to achieve that without temporary files:
sed "s/root/toor/" /etc/passwd | grep -v joey | sponge /etc/passwd
https://joeyh.name/code/moreutils/ https://joeyh.name/code/moreutils/