Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2. # Take all .html files in directory and covert them to .docx files for grading
  3. # Check all .html files in directory for the string "Passed all tests with no errors"
  4. # This way we can quickly sort files of people who may have had more trouble
  5. # Move files that pass into a seperate directory than those with failed tests.
  6. str="Passed all tests with no errors"
  7. for file in *.html; do
  8. pandoc -o "${file%.*}.docx" -s -S "$file"
  9. if grep -q "$str" "$file"; then
  10. mv "${file%.*}.docx" ../docx/testPass/
  11. else
  12. mv "${file%.*}.docx" ../docx/testFail/
  13. fi
  14. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement