From 7771539fb4397a7831b07fe0330536e6a55a7356 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sun, 15 Oct 2023 14:48:43 -0400 Subject: [PATCH] we don't need to do "cat X | foo" when we can do "foo X" --- src/tests/modules/linelog/linelog.unlang | 2 +- .../modules/smtp/smtp_attachment/tls_attachment.unlang | 6 +++--- src/tests/modules/smtp/smtp_crln/tls_crln.unlang | 3 +-- .../modules/smtp/smtp_stringparse/tls_stringparse.unlang | 3 +-- src/tests/modules/smtp/tls_delivery.unlang | 6 +++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/tests/modules/linelog/linelog.unlang b/src/tests/modules/linelog/linelog.unlang index 417d8d3f9a60..f0f9dafaf02e 100644 --- a/src/tests/modules/linelog/linelog.unlang +++ b/src/tests/modules/linelog/linelog.unlang @@ -324,7 +324,7 @@ else { test_fail } -&Tmp-Integer-0 := `/bin/sh -c "cat $ENV{MODULE_TEST_DIR}/test_e.log | wc -l"` +&Tmp-Integer-0 := `/bin/sh -c "wc -l $ENV{MODULE_TEST_DIR}/test_e.log"` if (&Tmp-Integer-0 == 3) { test_pass diff --git a/src/tests/modules/smtp/smtp_attachment/tls_attachment.unlang b/src/tests/modules/smtp/smtp_attachment/tls_attachment.unlang index 5be8abf8e6e3..e4c540511b09 100644 --- a/src/tests/modules/smtp/smtp_attachment/tls_attachment.unlang +++ b/src/tests/modules/smtp/smtp_attachment/tls_attachment.unlang @@ -44,9 +44,9 @@ echo $?"` == "1") { # Pull out the base64 encoded test, decode it, trim line endings # Compare the result with the expected output # -if !(`/bin/sh -c "cat build/ci/exim4/mail/smtp_attachment_receiver | \ -grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' | base64 -d | tr -d '\r\n' | \ -grep -f build/ci/exim4/testfile"`){ +if !(`/bin/sh -c "grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' build/ci/exim4/mail/smtp_attachment_receiver | \ + base64 -d | tr -d '\r\n' | \ + grep -f build/ci/exim4/testfile"`) { test_fail } diff --git a/src/tests/modules/smtp/smtp_crln/tls_crln.unlang b/src/tests/modules/smtp/smtp_crln/tls_crln.unlang index 87075245bb7f..9ecdc57a4f26 100644 --- a/src/tests/modules/smtp/smtp_crln/tls_crln.unlang +++ b/src/tests/modules/smtp/smtp_crln/tls_crln.unlang @@ -37,8 +37,7 @@ echo $?"` == "1") { test_fail } -if !(`/bin/sh -c "cat build/ci/exim4/mail/crln_test_receiver | \ -grep -E 'Most Body'"`) { +if !(`/bin/sh -c "grep -E 'Most Body' build/ci/exim4/mail/crln_test_receiver"`) { test_fail } diff --git a/src/tests/modules/smtp/smtp_stringparse/tls_stringparse.unlang b/src/tests/modules/smtp/smtp_stringparse/tls_stringparse.unlang index f71dc6a9b5ed..727d3a303336 100644 --- a/src/tests/modules/smtp/smtp_stringparse/tls_stringparse.unlang +++ b/src/tests/modules/smtp/smtp_stringparse/tls_stringparse.unlang @@ -32,8 +32,7 @@ echo $?"` == "1") { test_fail } -if !(`/bin/sh -c "cat build/ci/exim4/mail/stringparse_test_receiver | \ -grep -E 'Subject: for Bob'"`) { +if !(`/bin/sh -c "grep -E 'Subject: for Bob' build/ci/exim4/mail/stringparse_test_receiver"`) { test_fail } diff --git a/src/tests/modules/smtp/tls_delivery.unlang b/src/tests/modules/smtp/tls_delivery.unlang index eb0526c97e23..f619e84f757d 100644 --- a/src/tests/modules/smtp/tls_delivery.unlang +++ b/src/tests/modules/smtp/tls_delivery.unlang @@ -64,9 +64,9 @@ done ;"` == "found")) { # Pull out the base64 encoded test, decode it, trim line endings # Compare the result with the expected output # -if !(`/bin/sh -c "cat build/ci/exim4/mail/smtp_delivery_receiver | \ -grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' | base64 -d | tr -d '\r\n' | \ -grep -f build/ci/exim4/testfile"`){ +if !(`/bin/sh -c "grep -E '^[A-Za-z0-9+/]{4}*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$' build/ci/exim4/mail/smtp_delivery_receiver | \ + base64 -d | tr -d '\r\n' | \ + grep -f build/ci/exim4/testfile"`){ test_fail }