From 8ebc113847926922bb85fb5a01c175319fb1e8d4 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 4 Jul 2019 17:42:35 +0200 Subject: doc: improve docs for --replace flag Specifically, we document shell-specific caveats related to the `--replace` flag. PR #1318 --- src/app.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 92f908e4..fa322817 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2171,7 +2171,10 @@ Replace every match with the text given when printing results. Neither this flag nor any other ripgrep flag will modify your files. Capture group indices (e.g., $5) and names (e.g., $foo) are supported in the -replacement string. +replacement string. In shells such as Bash and zsh, you should wrap the +pattern in single quotes instead of double quotes. Otherwise, capture group +indices will be replaced by expanded shell variables which will most likely +be empty. Note that the replacement by default replaces each match, and NOT the entire line. To replace the entire line, you should match the entire line. -- cgit v1.2.3