-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.sh
executable file
·38 lines (32 loc) · 1.17 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
TOPICS=(
"01_prologue=Prologue"
"02_a_warm_up=A Warm Up!"
"03_random_sampling=Random Sampling"
"04_list_ranking=List Ranking"
"05_sorting_atomic_items=Sorting Atomic Items"
"E1_minimum_spanning_tree=Minimum Spanning Tree"
"06_set_intersection=Set Intersection"
"07_sorting_strings=Sorting Strings"
"08_the_dictionary_problem=The Dictionary Problem"
"09_searching_strings_by_prefix=Searching Strings by Prefix"
"10_searching_strings_by_substring=Searching Strings by Substring"
"11_integer_coding=Integer Coding"
"12_statistical_coding=Statistical Coding"
"13_dictionary_based_compressors=Dictionary-Based Compressors"
"14_the_borrows_wheeler_transform=The Borrows-Wheeler Transform"
"E2_randomised_data_structures=Randomized Data Structures"
)
OUT="% --------------- DO NOT EDIT --------------- %\\n% This file has been automatically generated. %\\n\\n"
for t in "${TOPICS[@]}"; do
FOLDR=${t%=*}
TITLE=${t#*=}
FILES="$(ls $FOLDR | grep \.tex$)"
if [ "$FILES" != "" ]; then
OUT="$OUT\\section{$TITLE}\\n"
for f in $FILES; do
OUT="$OUT\\input{$FOLDR/$f}\\n"
done
fi
done
echo -e "$OUT"