Given a task with several commands combined by pipe:
cat input/file1.json | jq '.responses[0] | {labelAnnotations: .labelAnnotations}' > output/file1.json
Now, there are thousands of input JSON files, and I like to leverage GNU Parallel to parallelize all process. How could I do that? Something like this?
parallel cat {} | jq '...' > output/{./} ::: input/*.json
note: It gets even more complicated if there is a pipe inside jq
's filter...