From d898898db2196e368fe4cfd493a793a1e6abdbf9 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 4 Nov 2025 15:11:50 +0100 Subject: [PATCH] src/bin/grepc: -r: Reimplement with grep(1) With grep(1), we don't need to hard-code escape sequences. Signed-off-by: Alejandro Colomar --- src/bin/grepc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/grepc b/src/bin/grepc index 627917652..70e312abe 100755 --- a/src/bin/grepc +++ b/src/bin/grepc @@ -78,7 +78,7 @@ else | xargs -0 sh -c 'pcre2grep $opts -f "$0" -- "$@" || test $? -eq 1;' "$patterns"; fi \ | if test "$r" = 'yes'; then - perl -p -e 's/('"$identifier"')/\033[32m\1\033[0m/'; + grep -h --color=always -P "($identifier|^)"; else cat; fi \ -- 2.47.3