diff options
| Commit | 9290c864ffa683cbeb4d5cb3f75399284a6a9cb2 (patch) | |
|---|---|---|
| Author | 2022-11-08 13:49:57 +0200 | |
| Committer | 2022-11-08 13:49:57 +0200 | |
| Files | 0736ab6b8143a6b504a7b0bc67cb432dcbddffbb | |
| uni-projects-9290c864ffa683cbeb4d5cb3f75399284a6a9cb2.tar uni-projects-9290c864ffa683cbeb4d5cb3f75399284a6a9cb2.tar.gz uni-projects-9290c864ffa683cbeb4d5cb3f75399284a6a9cb2.zip | ||
| Parent | df77490cd6eacc2112e6f297b075d1df992a0841 (diff) | |
[OKG] Added a rough extractor of JavaScript source from the HTML of the original programs
1 files changed, 8 insertions, 0 deletions
| -rwxr-xr-x | Year 2/Computer Graphics Fundamentals/ExerciseJSExtractor.sh | 8 |
diff --git a/Year 2/Computer Graphics Fundamentals/ExerciseJSExtractor.sh b/Year 2/Computer Graphics Fundamentals/ExerciseJSExtractor.sh new file mode 100755 index 0000000..46beab1 --- /dev/null +++ b/Year 2/Computer Graphics Fundamentals/ExerciseJSExtractor.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +createOKGProblemFile() { + awk 'BEGIN { injs = 0 } /<\/script>/ { injs = 0 } { if (injs == 1) { gsub(/^\t\t\t/, ""); print } } /<script>/ { injs = 1 }' "$1" > $(echo "$1" | awk '{ print substr($0, 88, 2) ".js" }') +} + +export -f createOKGProblemFile +find "/mnt/Norilsk/Uni/2 курс/Зимен семестър/Ж277 - ОКГ/Упражнения/Problems S06/" -type f -wholename "*/Problem*/Problem*.html" -exec bash -c 'createOKGProblemFile "{}"' \; |
