]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/grepc: Use if/else instead of && and ||
authorAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 21:12:09 +0000 (22:12 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 21:14:42 +0000 (22:14 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/bin/grepc

index 161f51b537e09739a0145e80eb980579ffcc7ecb..93446366cfa0b93ced3f316b9a34fdc26b04d822 100755 (executable)
@@ -248,9 +248,11 @@ else
 fi \
 | perl -p <(
        # shellcheck disable=SC2312  # We don't care about failures here.
-       test "$r" = 'yes' \
-       && printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/' \
-       || printf '%s\n' 's///';
+       if test "$r" = 'yes'; then
+               printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/';
+       else
+               printf '%s\n' 's///';
+       fi;
 ) \
 | if test -n "$l"; then
        sort \