jq icon indicating copy to clipboard operation
jq copied to clipboard

Add mul/0 builtin filter folding arrays with * similar to add/0 for +

Open syco opened this issue 1 year ago • 3 comments

https://github.com/jqlang/jq/blob/913b26469f47351a9f75a1bc4145f45421115e37/ChangeLog#L826-L829

Hi, when you add multiple files you can do either jq -s '.[0] + .[1] + .[2]' file0.json file1.json file2.json or jq -s 'add' *.json

can we have a similar syntax for jq -s '.[0] * .[1] * .[2]' file0.json file1.json file2.json ? Could maybe be: jq -s 'multiply' *.json

Thanks

syco avatar Feb 22 '24 23:02 syco