]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb: Do not use egrep
authorMartin Schwenke <mschwenke@ddn.com>
Mon, 10 Jul 2023 22:03:22 +0000 (08:03 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 19 Jul 2023 09:01:33 +0000 (09:01 +0000)
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 <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/CLUSTER/complex/scripts/local.bash
ctdb/tests/INTEGRATION/simple/cluster.090.unreachable.sh
ctdb/tools/ctdb_diagnostics

index 0e2addd5589f315f6d9c1fe24717b2f604291e52..0ef5c0acae82195fd79ea6ff798b7ac1ef8192f5 100644 (file)
@@ -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" ]
index 2835e55cd97b76b88d2c34903d89f2824a900c29..1410a12f7d4d6284ffe8b6a26cb66eaaa2e74563 100755 (executable)
@@ -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"
index 80a56575896877cdd52f60539f86757c8b7cae86..d16a71c8f30d07170848376b91ea2d9ddda89929 100755 (executable)
@@ -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'"