aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
authorAlejandro Colomar <alx@kernel.org>2025-10-29 21:57:48 +0100
committerAlejandro Colomar <alx@kernel.org>2025-10-29 22:03:13 +0100
commit6c78db3bb0f025f32fa6a5bdc46f110ce3ff6ff1 (patch)
tree25c3e3d40cb1ad028a5b5f9c5125397013051b16 /src
parentec6d9f99015c54275e1c5a9088f67e5f24d17cc7 (diff)
downloadman-pages-6c78db3bb0f025f32fa6a5bdc46f110ce3ff6ff1.tar.gz
src/bin/grepc: Use test(1) instead of [(1)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/bin/grepc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/bin/grepc b/src/bin/grepc
index 41b25742cc..01f52235bd 100755
--- a/src/bin/grepc
+++ b/src/bin/grepc
@@ -64,7 +64,7 @@ while getopts "A:B:C:chilm:nrt:x:" opt; do
n) n='-n'; ;;&
r) r='yes'; ;;&
t)
- if [ -z "$x" ]; then
+ if test -z "$x"; then
x='c';
fi;
@@ -116,10 +116,10 @@ while getopts "A:B:C:chilm:nrt:x:" opt; do
esac;
;;
x)
- if [ "$t" = 'yes' ]; then
+ if test "$t" = 'yes'; then
grepc_err "-$opt: This option must come before '-t'.";
fi;
- if [ -n "$x" ]; then
+ if test -n "$x"; then
grepc_err "-$opt: This option cannot be repeated.";
fi;
@@ -142,11 +142,11 @@ test $# -lt 1 && grepc_err "Missing identifier.";
identifier=$1;
shift;
-if [ -z "$x" ]; then
+if test -z "$x"; then
x='c';
fi;
-if [ "$t" = 'no' ]; then
- if [ "$x" = 'c' ]; then
+if test "$t" = 'no'; then
+ if test "$x" = 'c'; then
t_e='yes';
t_fp='yes';
t_fd='yes';
@@ -161,7 +161,7 @@ if [ "$t" = 'no' ]; then
t_t_td_simple='yes';
t_t_td_braced='yes';
t_t_td_func='yes';
- elif [ "$x" = 'mk' ]; then
+ elif test "$x" = 'mk'; then
t_v='yes';
fi;
fi;
@@ -199,7 +199,7 @@ patterns="$(mktemp -t grepc.patterns.XXXXXX)";
(
- if [ "$x" = 'c' ]; then
+ if test "$x" = 'c'; then
test $t_e = yes && grepc_c_e "$identifier";
test $t_fp = yes && grepc_c_fp "$identifier";
test $t_fd = yes && grepc_c_fd "$identifier";
@@ -221,7 +221,7 @@ patterns="$(mktemp -t grepc.patterns.XXXXXX)";
test $t_ut_su = yes && grepc_c_ut_su "$identifier";
test $t_ut_td_simple = yes && grepc_c_ut_td_simple "$identifier";
test $t_ut_td_su = yes && grepc_c_ut_td_su "$identifier";
- elif [ "$x" = 'mk' ]; then
+ elif test "$x" = 'mk'; then
test $t_r = yes && grepc_mk_r "$identifier";
test $t_v = yes && grepc_mk_v "$identifier";
fi;
@@ -248,7 +248,7 @@ fi \
&& printf '%s\n' 's/('"$identifier"')/\033[32m\1\033[0m/' \
|| printf '%s\n' 's///';
) \
-| if [ -n "$l" ]; then
+| if test -n "$l"; then
sort \
| uniq;
else