Skip to content

Instantly share code, notes, and snippets.

@waynegraham
Created July 28, 2021 12:37
Show Gist options
  • Save waynegraham/85babcaaa3cf79bf2ce54bd0a5818be7 to your computer and use it in GitHub Desktop.
Save waynegraham/85babcaaa3cf79bf2ce54bd0a5818be7 to your computer and use it in GitHub Desktop.
Convert Word to pdf
#! /bin/bash
for file in *.doc; do
textutil -convert docx "$file"
# Account for the new `x` in `docx`
pandoc -o "${file%doc}pdf" "${file}x"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment