2

I can use the following command to print all changed file and content in the stdout

rg --passthru -F "red" -r "green" -N

Output:

ip.txt
blue test1
green 2
hello blue world

ip2.txt
blue test1
green 2
hello blue world

ip3.txt
green test1
green 2
hello green world

ip4.txt
green test1
green 2
hello green world

how to write these files with changed content to the original file.

oguz ismail
  • 1
  • 16
  • 47
  • 69
Owen Young
  • 157
  • 2
  • 8

1 Answers1

0

You can't with ripgrep alone. ripgrep doesn't support it by design. It never writes to files. It only reads them.

BurntSushi5
  • 13,917
  • 7
  • 52
  • 45