Using "sub()" in jq v1.6 errors in "sub is not defined"

Viewed 784
1 Answers

Its a minor typo, the sub() function along with the other functions in jq takes arguments separated by ; and not , which is an operator in the context of jq. It should have been written as

sub("b"; "f")

The error is likely because the runtime wasn't able to match the your call to to the actual signature of the sub() function.

Related