From ebb8dac4657aa7af9af891c75b4c08d4cf7ea1fc Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 7 Oct 2024 22:02:56 +0200 Subject: [PATCH] Escape first percent sign once --- bot/check-test.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot/check-test.sh b/bot/check-test.sh index e18ed64a84..cb426f7468 100755 --- a/bot/check-test.sh +++ b/bot/check-test.sh @@ -77,13 +77,15 @@ if [[ ! -z ${grep_reframe_failed} ]]; then else # Grep the entire output of ReFrame, so that we can report it in the foldable section of the test report GP_success_full='(?s)\[----------\] start processing checks.*?\[==========\] Finished on [a-zA-Z0-9 ]*' - # tr '\0' '\n' places back the newline characters that the -z option of grep turned into null characters + # Replace null character with
+ # Replace new line characters with
+ # Replace % with \%. Use \\% to interpret \ as character, instead of escape character grep_reframe_success_full=$( \ grep -v "^>> searching for " ${job_dir}/${job_out} | \ grep -Pzo "${GP_success_full}" | \ - sed 's/\x00//g' | # Replace null character with
- sed ':a;N;$!ba;s/\n//g' | # Replace new line characters with
- sed 's/%/\\%/g' \ # Replace % with \%. Use \\% to interpret \ as character, instead of escape character + sed 's/\x00//g' | + sed ':a;N;$!ba;s/\n//g' | + sed 's/\%/\\%/g' \ ) grep_reframe_result=${grep_reframe_success_full} echo "grep_reframe_success_full: ${grep_reframe_success_full}"