Skip to content

Instantly share code, notes, and snippets.

@aprell
Created February 10, 2014 18:40
Show Gist options
  • Save aprell/8921632 to your computer and use it in GitHub Desktop.
Save aprell/8921632 to your computer and use it in GitHub Desktop.
Convert all EPS files in a directory to PDF
#!/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