在哪里放置自定义 JQ 函数?

Where to put custom JQ functions?

我找到了一组很好的定义,我想在 jq(https://github.com/stedolan/jq/blob/master/src/builtin.jq) 中使用。我必须使用的版本没有内置它们。该页面提到将这些定义用于新功能。

我想知道将这些定义放在哪里,以便我的本地 jq 可以访问它们。

来自Modules section of the manual

[...]

The default search path is the search path given to the -L command-line option, else ["~/.jq", "$ORIGIN/../lib/jq", "$ORIGIN/../lib"]

[...]

If “$HOME/.jq” is a file, it is sourced into the main program.

$ORIGIN 似乎指的是包含 jq 二进制文件本身的目录。