Merge pull request #1669 from micmac1/master-jsonrpc-portable
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 11 Oct 2018 22:33:54 +0000 (00:33 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Oct 2018 22:33:54 +0000 (00:33 +0200)
kamctl: make jsonrpc filter portable

utils/kamctl/kamctl.base

index adeceb7..a776e10 100644 (file)
@@ -715,7 +715,7 @@ filter_json()
        $AWK 'function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
                BEGIN { line=0; IGNORECASE=1; }
                { line++; }
-               NR == 1 && /^{.+"id"[ \t]*:[ \t]*[0-9]+[ \t]*}$/ { print; next; }
+               NR == 1 && /^[{].+"id"[ \t]*:[ \t]*[0-9]+[ \t]*}$/ { print; next; }
                NR == 1 && /^200 OK/ { next; }
                /^[ \t]*"jsonrpc":[ \t]*"2.0"/ { print; next; }
                /^[ \t]*"result":[ \t]*\[.+/ {