3 ms·
My memory is to sed -i -e 's/pattern/replacement/' file, the addition of -e was perhaps subconsciously to help protect against this eventuality by mentally segr
by contingencies 9y ago
My memory is to sed -i -e 's/pattern/replacement/' file, the addition of -e was perhaps subconsciously to help protect against this eventuality by mentally segregating my standard pipeline invocation which takes neither argument.
Anyway sed is so fast you should definitely check the output before overwriting stuff. Same goes for anything on the command line.
Get ZFS. Do snapshots.
- ramshorns 9y ago> you should definitely check the output before overwriting stuff That wouldn't really help in the case of redirecting sed to the same file. $ echo "a" > test.txt $ sed s/a/b/ test.txt b $ sed s/a/b/ test.txt > test.txt $ cat test.txt $
- contingencies 9y agoIndeed. Use >> in preference to > at all times ;)