composeBook.sh
1 #!/bin/bash 2 cat ../title.md 3 hash=$(git rev-parse --verify HEAD) 4 echo -e "Commit-hash: ${hash}" 5 echo -e "\n" 6 cat ../disclaimer.txt 7 echo -e "\n" 8 echo "\tableofcontents" 9 for i in $(seq 1 8) 10 do 11 echo -e ".\n" 12 done 13 echo -e "\n" 14 cat ../README.md 15 echo -e "\n" 16 mapfile -t title < "../index.txt" 17 j=0 18 for i in $(cat ../index.txt) 19 do 20 j=$((j+1)) 21 echo -e "# ${j}. ${i} \n \n" 22 cat "../${i}.txt" 23 echo -e " \n" 24 done