2021-04-07 17:27:02 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Use grep and sed to replace $1 with $2 recursively and print what is done
|
2021-04-13 17:20:24 +02:00
|
|
|
grep --null --recursive --files-with-matches --binary-files=without-match "$1" |
|
2021-04-07 17:27:02 +02:00
|
|
|
xargs -0 sed -i "/${1}/{
|
|
|
|
s//${2}/g
|
|
|
|
w /dev/stdout
|
|
|
|
}"
|
|
|
|
|