#!/bin/bash # Counts the number of cards in the given deck. yq r -j cards.yaml | jq -r --arg deckname "$1" '.decks[] | select(.name | test($deckname; "i")) | .cards | length'