#!/usr/bin/env bash shopt -s globstar for x in systems/*/metadata.yml; do cat $x | yq --indent 2 > ${x%metadata.yml}system.json done