From: Alejandro Colomar Date: Thu, 30 Oct 2025 09:41:55 +0000 (+0100) Subject: src/bin/grepc: Refactor to avoid process substitution X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1875ec53a613c524c90f53239ea513154279410;p=thirdparty%2Fman-pages.git src/bin/grepc: Refactor to avoid process substitution Signed-off-by: Alejandro Colomar --- diff --git a/src/bin/grepc b/src/bin/grepc index f0efba36e..1758320df 100755 --- a/src/bin/grepc +++ b/src/bin/grepc @@ -247,14 +247,11 @@ else fi \ | xargs -0 pcre2grep "${opts[@]}" -f "$patterns"; fi \ -| perl -p <( - # shellcheck disable=SC2312 # We don't care about failures here. - if test "$r" = 'yes'; then - printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/'; - else - printf '%s\n' 's///'; - fi; -) \ +| if test "$r" = 'yes'; then + perl -p -e 's/('"$identifier"')/\033[32m\1\033[0m/'; +else + cat; +fi \ | if test -n "$l"; then sort \ | uniq;