Skip to content

Replace inplace? #2568

Answered by s-p-turner
jmigual asked this question in General
Jul 25, 2023 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

The documentation for the -r flag states: "Replace every match with the text given when printing results. Neither this flag nor any other ripgrep flag will modify your files."

I doubt the authors would want to modify ripgrep to do in-place editing of files. And neither should they in my opinion, as it's a file search utility and not a file editing utility. I would suggest either writing a script and/or using the find utility to iterate over your files and use sed -i to replace your text instead.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@BurntSushi
Comment options

Answer selected by jmigual
Comment options

You must be logged in to vote
3 replies
@BurntSushi
Comment options

@BurntSushi
Comment options

@s-p-turner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants