Skip to content

Instantly share code, notes, and snippets.

@instantiator
Created January 5, 2021 17:04
Show Gist options
  • Select an option

  • Save instantiator/af461a3ffbb6ea8022064b13f8ac432e to your computer and use it in GitHub Desktop.

Select an option

Save instantiator/af461a3ffbb6ea8022064b13f8ac432e to your computer and use it in GitHub Desktop.
summarise the entity ids found in yaml configuration files
#!/bin/bash
# provide the path to your configuration yaml files as the only parameter
DIR=$1
echo \"file\",\"simple id\",\"LOAs\",\"entity id\",\"MSA entity id\"
for FILE in "$DIR"/*.yml; do
FILENAME=$(basename $FILE)
SIMPLE_ID=$(yq eval '.simpleId' $FILE)
LOAs=$(yq eval '.levelsOfAssurance' $FILE)
TRANSACTION_ENTITY_ID=$(yq eval '.entityId' $FILE)
MSA_ENTITY_ID=$(yq eval '.matchingServiceEntityId' $FILE)
echo \"$FILENAME\",\"$SIMPLE_ID\",\"$LOAs\",\"$TRANSACTION_ENTITY_ID\",\"$MSA_ENTITY_ID\"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment