Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Take all .html files in directory and covert them to .docx files for grading
- # Check all .html files in directory for the string "Passed all tests with no errors"
- # This way we can quickly sort files of people who may have had more trouble
- # Move files that pass into a seperate directory than those with failed tests.
- str="Passed all tests with no errors"
- for file in *.html; do
- pandoc -o "${file%.*}.docx" -s -S "$file"
- if grep -q "$str" "$file"; then
- mv "${file%.*}.docx" ../docx/testPass/
- else
- mv "${file%.*}.docx" ../docx/testFail/
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement