[DTrace-devel] [PATCH] test: replace gawk-specific function with more generic function

Nick Alcock nick.alcock at oracle.com
Mon May 22 17:54:26 UTC 2023


On 22 May 2023, Kris Van Hees via DTrace-devel told this:

> The match(s, t, arr) form of the match function is specific to GAWK

I'm honestly surprised that's our only gawkism (given that I wrote this
code and I care so little about avoiding gawkisms that they tend to
creep into what I write regardless).

> and is thus best avoided in favour of the more generic split function
> split(s, arr, t).

Looks fine (assuming it works, I guess you tested it).

> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>  runtest.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/runtest.sh b/runtest.sh
> index b1f1dced..eafb16d2 100755
> --- a/runtest.sh
> +++ b/runtest.sh
> @@ -1548,7 +1548,7 @@ else
>   }
>  /: X?(FAIL|PASS|SKIP).*after ([0-9]*) reinvocations/
>  {
> -	match($0, /after ([0-9]*) reinvocations/, reinvokes);
> +	split($0, reinvokes, /after ([0-9]*) reinvocations/);
>  	count["REINVOKES"] += reinvokes[1];
>  }
>   END {

-- 
NULL && (void)



More information about the DTrace-devel mailing list