From 862fc5770cb672e91622fdfc01a46dc155a8c723 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 11 Jul 2023 08:03:22 +1000 Subject: [PATCH] ctdb: Do not use egrep On some platforms, egrep prints a deprecation warning to stderr: egrep: warning: egrep is obsolescent; using grep -E Use grep -E instead. This is nice and simple, so no use splitting this commit into 2 separate commits for each of tools and test. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/CLUSTER/complex/scripts/local.bash | 2 +- ctdb/tests/INTEGRATION/simple/cluster.090.unreachable.sh | 2 +- ctdb/tools/ctdb_diagnostics | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ctdb/tests/CLUSTER/complex/scripts/local.bash b/ctdb/tests/CLUSTER/complex/scripts/local.bash index 0e2addd5589..0ef5c0acae8 100644 --- a/ctdb/tests/CLUSTER/complex/scripts/local.bash +++ b/ctdb/tests/CLUSTER/complex/scripts/local.bash @@ -39,7 +39,7 @@ get_src_socket () local pat="^${proto}6?[[:space:]]+[[:digit:]]+[[:space:]]+[[:digit:]]+[[:space:]]+[^[:space:]]+[[:space:]]+${dst_socket//./\\.}[[:space:]]+ESTABLISHED[[:space:]]+${pid}/${prog}[[:space:]]*\$" out=$(netstat -tanp | - egrep "$pat" | + grep -E "$pat" | awk '{ print $4 }') [ -n "$out" ] diff --git a/ctdb/tests/INTEGRATION/simple/cluster.090.unreachable.sh b/ctdb/tests/INTEGRATION/simple/cluster.090.unreachable.sh index 2835e55cd97..1410a12f7d4 100755 --- a/ctdb/tests/INTEGRATION/simple/cluster.090.unreachable.sh +++ b/ctdb/tests/INTEGRATION/simple/cluster.090.unreachable.sh @@ -30,7 +30,7 @@ pat="ctdb_control error: 'ctdb_control to disconnected node'|ctdb_control error: for i in ip disable enable "ban 0" unban listvars ; do try_command_on_node -v 0 ! $CTDB $i -n $test_node - if egrep -q "$pat" "$outfile" ; then + if grep -Eq "$pat" "$outfile" ; then echo "OK: \"ctdb ${i}\" fails with expected \"disconnected node\" message" else echo "BAD: \"ctdb ${i}\" does not fail with expected \"disconnected node\" message" diff --git a/ctdb/tools/ctdb_diagnostics b/ctdb/tools/ctdb_diagnostics index 80a56575896..d16a71c8f30 100755 --- a/ctdb/tools/ctdb_diagnostics +++ b/ctdb/tools/ctdb_diagnostics @@ -228,7 +228,7 @@ Showing software versions EOF show_all "uname -a" [ -x /bin/rpm ] && { - show_all "rpm -qa | egrep 'samba|ctdb|gpfs'" + show_all "rpm -qa | grep -E 'samba|ctdb|gpfs'" } [ -x /usr/bin/dpkg-query ] && { show_all "/usr/bin/dpkg-query --show 'ctdb'"