Guest User

Untitled

a guest
Mar 21st, 2024
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ROOT_DIR="/path/to/text/files/you/just/made/"
  4.  
  5. for year in "$ROOT_DIR"/*; do
  6. if [ -d "$year" ]; then
  7. for month in "$year"/*; do
  8. if [ -d "$month" ]; then
  9. cd "$month"
  10. for file in *.txt; do
  11. pandoc "$file" --pdf-engine=xelatex -o "${file%.txt}.pdf" && rm "$file"
  12. done
  13. cd "$ROOT_DIR"
  14. fi
  15. done
  16. fi
  17. done
Advertisement
Add Comment
Please, Sign In to add comment