Created
February 10, 2014 18:40
-
-
Save aprell/8921632 to your computer and use it in GitHub Desktop.
Convert all EPS files in a directory to PDF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
case "$1" in | |
"-h" | "--help") | |
echo "Usage: eps2pdf [directory]" | |
echo "" | |
echo "Convert all EPS files in a specified directory to PDF." | |
echo "If no directory is specified, assume the current working directory." | |
echo "" | |
exit 0 | |
;; | |
esac | |
if [ $# -eq 0 ]; then | |
dir=$(pwd) | |
else | |
dir=$1 | |
fi | |
if [ ! -d "$dir" ]; then | |
echo "Directory \"$dir\" does not exist." | |
exit 1 | |
fi | |
for file in "$dir"/*.eps; do | |
epstopdf "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment