https://gitlab.com/formalcow/combinatorics-on-words-formalized
Raw File
Tip revision: a4ae71365568015f2f8958c96856fd8b8e9a180a authored by Štěpán Starosta on 14 May 2021, 15:37:50 UTC
v1.4.0: renamed directories to match session names, several small additions (incl. some code equations), many optimizations; moved CoW/Borders into CoW/CoWBasic
Tip revision: a4ae713
remove_session.sh
#!/usr/bin/env bash

# shopt -s globstar
dirs=(.. ../Basics ../Lyndon ../Graph_Lemma ../examples ../Equations ../Textbook)
target="../Combinatorics-On-Words-Formalized"

echo "There are ${#dirs[@]} dirs in the current path"
echo "Target is ${target}."

mkdir ${target}

let i=1

for dir in "${dirs[@]}"; do
    echo "$((i++)) $dir"
    # readarray -t dirs < <(find . -maxdepth 1 -type d -printf '%P\n')
    find $dir -name "*.thy" -maxdepth 1 -type f -print0 | while read -d $'\0' file
		do
		    echo "…code using ${file}"
		    cp ${file} "${target}/$(basename $file)"
		    sed -i '
s/CoW\.//g
s/CoW_Lyndon\.//g
s/CoW_Graph_Lemma\.//g
s/CoW_Equations\.//g
s/\@{theory CoWBasic\}/CoWBasic/g
' "${target}/$(basename $file)"
		done
done
back to top