From 6e4f30c79ad8e6fd9307759f47f34e088351b382 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 21 Dec 2024 16:58:15 -0300 Subject: bin/re: Use extended regexes in sed(1) --- bin/re | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/re b/bin/re index 774c02c..6c4c257 100755 --- a/bin/re +++ b/bin/re @@ -79,11 +79,11 @@ shift replace() { FILE="$1" # shellcheck disable=2094 - if ! sed "$REGEXP" < "$FILE" | cmp -s - "$FILE"; then + if ! sed -E "$REGEXP" < "$FILE" | cmp -s - "$FILE"; then if [ ! -e "$FILE" ]; then return 1 fi - sed "$REGEXP" < "$FILE" | sponge "$FILE" + sed -E "$REGEXP" < "$FILE" | sponge "$FILE" fi } -- cgit v1.2.3