Skip to content

Commit

Permalink
Use | instead of / in rreplace
Browse files Browse the repository at this point in the history
`/` is commonly used in paths and requires escaping in `sed` but not in
`rg` which makes using it tricky
(BurntSushi/ripgrep#434).
  • Loading branch information
jgonera committed Mar 24, 2020
1 parent 6e871d0 commit 94c6d48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/bin/rreplace
Expand Up @@ -11,4 +11,4 @@ shift
REPLACE_WITH=$1
shift

rg -l "$FIND_THIS" $* | xargs sed -E -i '' "s/$FIND_THIS/$REPLACE_WITH/g"
rg -l "$FIND_THIS" "$@" | xargs sed -E -i '' "s|$FIND_THIS|$REPLACE_WITH|g"

0 comments on commit 94c6d48

Please sign in to comment.