Showing posts with label bash script. Show all posts
Showing posts with label bash script. Show all posts

Tuesday, April 30, 2013

How to convert all eps files to pdf in a directory

If you just want to convert a single file, you can use epstopdf <file>
as described here

Sometimes I need to convert all the eps files to pdf, for instance because I use latexpdf and I have all the images in eps. Here is a short linux bash script that does the job.


#/usr/bin/bash
for file in *.eps
do
  epstopdf $file
done

This I have in a script file in the path. Don't forget to install the ghostscript package to be able to use epstopdf command.

Or another solution is using the find command:

 $ find . -name "*.eps" -exec epstopdf {} \;

as described in  http://www.linuxquestions.org/questions/linux-newbie-8/using-multiple-epstopdf-command-854618/