#/bin/bash YEARNOW="$(date +%Y)" YEARNEXT="$(date -d "next year" +%Y)" (echo "["; curl -s https://holidata.net/en-US/$YEARNOW.json | sed "s/$/,/g"; curl -s https://holidata.net/en-US/$YEARNEXT.json | sed "s/$/,/g" | head -c-2; echo "]") | jq -r 'map(select(.region == "")) | to_entries | map((.key+1 | tostring) + "\t" + .value.description + "\t" + .value.date) | .[]' | while read e; do INDX="$(echo "$e" | cut -f1)" NAME="$(echo "$e" | cut -f2)" DATE="$(echo "$e" | cut -f3 | tr -d "-")" echo "holiday.en-US$INDX.name=$NAME" echo "holiday.en-US$INDX.date=$DATE" done