From bd67671fad8104df9322d44ef56c9787dd366ba2 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 1 Sep 2026 16:19:52 +0200 Subject: [PATCH] double quoting needed in passed expression to grep --- t/03_syntax_check.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/03_syntax_check.t b/t/03_syntax_check.t index 586f47c..0d9fc1f 100755 --- a/t/03_syntax_check.t +++ b/t/03_syntax_check.t @@ -7,8 +7,8 @@ use warnings; use Test::More; my $tests = 0; -my $prg="testssl.sh"; -my $os="$^O"; +my $prg = "testssl.sh"; +my $os = "$^O"; if ( $os eq "darwin" ){ plan skip_all => 'No checks on MacOS'; @@ -28,7 +28,7 @@ $tests++; #2 printf "\n%s\n", "Testing for backticks ..."; -my @matches = qx(grep -nP '`[^`]*`' $prg); +@matches = qx(grep -nP '`[^`]*`' $prg); is(scalar(@matches), 0, "Checking bad backtick patterns") or diag(@matches); $tests++; @@ -36,7 +36,7 @@ $tests++; #3 printf "\n%s\n", "Sourcing without checking the file exists #1 ..."; -my @matches = qx(grep -nP '^\s*\.\s+\$' $prg); +@matches = qx(grep -nP '^\\s*\\.\\s+\\$' $prg); is(scalar(@matches), 0, "Checking bad sourcing pattern #1") or diag(@matches); $tests++; @@ -44,7 +44,7 @@ $tests++; #4 printf "\n%s\n", "Sourcing without checking the file exists #2 ..."; -my @matches = qx(grep -nP '^\s*source\s+\$' $prg); +@matches = qx(grep -nP '^\\s*source\\s+\\$' $prg); is(scalar(@matches), 0, "Checking bad sourcing pattern #2") or diag(@matches); $tests++;