2022-04-28 17:15:51 +01:00
|
|
|
#!/bin/bash -e
|
2021-04-07 17:27:02 +02:00
|
|
|
# Use grep and sed to replace $1 with $2 recursively and print what is done
|
2021-05-02 19:35:50 +02:00
|
|
|
grep --null --recursive --files-with-matches \
|
2022-07-18 11:56:48 +01:00
|
|
|
--binary-files=without-match $(echo $DIRS_IGNORE | sed 's/-x/--exclude-dir/g') "${@:3}" -- "$1" |
|
2022-04-12 19:31:46 +02:00
|
|
|
xargs -0 sed -i "\%${1}%{
|
2021-05-05 08:56:44 +02:00
|
|
|
s||${2}|g
|
2021-04-07 17:27:02 +02:00
|
|
|
w /dev/stdout
|
|
|
|
}"
|