diff --git a/docx-to-pdf.sh b/docx-to-pdf.sh new file mode 100644 index 0000000..1fce4e5 --- /dev/null +++ b/docx-to-pdf.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +initialPath=$(pwd) +find . -type f -name '*.doc*' | sed -r 's|/[^/]+$||' | sort -u | while read dir; do + cd "$dir" + find . -type f -name '*.doc*' | while read file; do + soffice --headless --convert-to pdf "$file" + echo "$file" | sed -e 's|^\./||' | sed 's/docx?/pdf/' | tee -a contents + done + cd "$initialPath" +done