7 ms·
See the first example on the web page: % sed "s/root/toor/" /etc/passwd | grep -v joey | sponge /etc/passwd If you tried this as: % sed "s/root/toor/" /e
by fred256 6y ago
See the first example on the web page:
% sed "s/root/toor/" /etc/passwd | grep -v joey | sponge /etc/passwd
If you tried this as:
% sed "s/root/toor/" /etc/passwd | grep -v joey > /etc/passwd
The shell would overwrite /etc/passwd with an empty file before sed has a chance to read from it.