(no title)
zaidhaan | 2 years ago
$ rg --passthru search -r replace file.txt | sponge file.txt
And preview changes like this: $ rg --passthru search -r replace file.txt | diff -u file.txt -
Of course, this is only practical when working with a single file. Though I'd imagine if one threw in the `--files-with-matches -0` flags together and piped that into `xargs`, something similar to `rep` could be be achieved. (Not that I'd encourage anyone to do this at all)
rgun|2 years ago
Why so?
zaidhaan|2 years ago
I just personally would feel more confident with using perl for anything to do with multi-file substitutions. In theory, ripgrep with `--passthru` and `-r` should work.