Preferences

I could swear I used it to do just that a handful of times in the past. But my brain's been a bit scrambled recently so I'm probably misremembering now. I know for sure I made use of the replace option and was happy it was there and that using it felt better than using sed.

I guess it does make sense now that I think about it that ripgrep wouldn't do in-place edits. If ripgrep never performs writes, there's never a chance of a mistake in usage or bug in the software clobbering files in bulk.


I maintain a pair of tools that can do in-place file replacements on ripgrep output (https://github.com/robenkleene/rep-grep) and rename files based on `fd` output (https://github.com/robenkleene/ren-find).
> If ripgrep never performs writes, there's never a chance of a mistake in usage or bug in the software clobbering files in bulk.

Yeah that's exactly why it doesn't.

It is true that the `-r/--replace` flag can replace a number of `sed` and `awk` use cases. It has for me at least.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal