#!/usr/bin/env bash shopt -s globstar for x in **/corpus.jsonl; do cat $x | jq -sc > $(dirname $x)/$(basename $x .jsonl).json; done