diff --git a/bin/br b/bin/br new file mode 100755 index 0000000..6d9ed73 --- /dev/null +++ b/bin/br @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$#" -lt 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +REDFG=$(printf '\033[31m') +BLUBG=$(printf '\033[42m') +ag --color "$1" . | sed -E "s/$1/\\0$REDFG$BLUBG$2/g" +echo Are they ok for you? +read -r YN + +case "$YN" in + y|Y) + ag "$1" . -l -0 | xargs -0 sed -Ei "s/$1/$2/g" + ;; + *) + exit + ;; +esac