]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
bin/grepc: Use <() instead of $()
authorAlejandro Colomar <alx@kernel.org>
Sat, 1 Mar 2025 16:52:43 +0000 (17:52 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:28 +0000 (21:29 +0100)
Files are simpler to handle.  It results in less flags, and simpler
command invocations.  And it allows breaking the line more nicely,
without having to break in the middle of a quoted region.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
bin/grepc

index b8d3cde3f84719ac44217c0ea9c1cb5d2e603ed3..6d9c79b7887fcb05bcb1f950c5018cbbf1a83d40 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -237,7 +237,11 @@ else
        fi \
        | xargs pcre2grep "${opts[@]}" -f "$patterns";
 fi \
-| perl -pe "$(test "$r" = 'yes' && printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/' || printf '%s\n' 's///')" \
+| perl -p <(
+       test "$r" = 'yes' \
+       && printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/' \
+       || printf '%s\n' 's///';
+) \
 | if [ -n "$l" ]; then
        sort \
        | uniq;