-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgen-md.sh
51 lines (42 loc) · 1.57 KB
/
gen-md.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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Base directory
base_dir="NEP2020"
for upper_folder in "$base_dir"/*; do
# Loop through each folder in NEP2020/
for folder in "$upper_folder"/*; do
# Check if it's a directory
if [ -d "$folder" ]; then
echo "Processing folder: $folder"
# Loop through each subfolder in the current folder
for subfolder in "$folder"/*/; do
# Check if it's a directory
if [ -d "$subfolder" ]; then
echo " Processing subfolder: $subfolder"
# Change to the subfolder
cd "$subfolder" || continue
# Run the specified commands
bash ../../../../helper-scripts/gen-assign.sh
bash ../../../../helper-scripts/gen-lab.sh
bash ../../../../helper-scripts/gen-solved.sh
# Output lab.md
echo "Outputting $(pwd)/lab.md"
# Assuming you want to create or modify lab.md here
# (Add your output command here if needed)
cat lab.md
# Output assignment.md
echo "Outputting $(pwd)/assignment.md"
# (Add your output command here if needed)
cat assignment.md
# Output solved.md
echo "Outputting $(pwd)/solved.md"
# (Add your output command here if needed)
cat solved.md
# Return to the previous directory
cd - || exit
fi
done
else
echo "Skipping non-directory: $folder"
fi
done
done