Home » English » Convert multiple ps files into pdf using ps2pdf

Convert multiple ps files into pdf using ps2pdf

Unfortunately ps2pdf doesn’t allow that. But with a script as simple as that it will convert all ps files in your working directory into pdf and delete the original files:

#!/bin/bash
##
## Written by Leonard Burtscher (burtscher@mpia.de)
## 20 Apr 2010
##
##
## PURPOSE
##
##
## To transform all ps files of a directory into pdf using ps2pdf
## Then delete all ps files
##
filelist=`(find . -name \*.ps)`
for i in $filelist; do
ps2pdf $i
rm $i
echo ‘Converted $i into pdf, deleted original file.’
done
#!/bin/bash

filelist=`(find . -name \*.ps)`

for i in $filelist; do

        ps2pdf $i

        rm $i

        echo 'Converted $i into pdf, deleted original file.'

done

4 Comments

  1. thank you for your help, but the command “find . -name *.ps” didn’t work I used “find . -perm -000” and make sure that only files that have to be converted in the directory

Leave a comment

My Tweets