devops-exercises/scripts/count_questions.sh
abregman e6a80309e0 Add Terraform and Linux questions and exercises
Also updated the script that counts questions to actually update
the number in README.md
2022-10-30 22:08:05 +02:00

10 lines
280 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
count=$(echo $(( $(grep -E "\[Exercise\]|</summary>" -c README.md topics/*/README.md | awk -F: '{ s+=$2 } END { print s }' ))))
echo "There are $count questions and exercises"
sed -i "s/currently \*\*[0-9]*\*\*/currently \*\*$count\\**/" README.md