4 ms·
Re sponge: the shell will open the output file for writing before invoking the command so in the example joey provides, /etc/passwd will be an empty file by the
by charliesome 6y ago
Re sponge: the shell will open the output file for writing before invoking the command so in the example joey provides, /etc/passwd will be an empty file by the time sed opens it.
- samatman 6y agoheh, yeah that's a mistake everyone makes once, and hopefully not more than once.
- prakashdanish 6y agoThat makes sense but in the example provided, why can't we use sed with the in-line flag?
- gpanders 6y agoBecause the -i flag works differently on GNU sed vs non-GNU sed and there is no way to use it portably.