dotfiles/.local/bin/scripts/rpl
2021-05-05 08:56:44 +02:00

9 lines
268 B
Bash
Executable file

#!/bin/sh
# Use grep and sed to replace $1 with $2 recursively and print what is done
grep --null --recursive --files-with-matches \
--binary-files=without-match --exclude-dir={.sync,.stfolder,.git} "$1" |
xargs -0 sed -i "\|${1}|{
s||${2}|g
w /dev/stdout
}"