#!/bin/bash # -i input1,input2,.... -o output.pdf # needs ghostscript-esp-7 usage() { echo echo "Converts one or more postscript files to pdf" echo echo "Usage:" echo " $(basename $0) input1,input2,... output" echo echo "written by Niels Rogalla " echo exit 1 } [ $# -ne 2 ] && usage INPUT_FILES="$1" OUTPUT_FILE="$2" TEMP="/var/tmp/ps2pdf-ext-$$.ps" echo echo "ps2pdf-extended, Niels Rogalla " echo #create a empty temp file :> ${TEMP} OLD_IFS="$IFS" IFS="," for i in ${INPUT_FILES} do echo " Processing ${i} ..." cat ${i} >> ${TEMP} done IFS="${OLD_IFS}" echo -n " Creating PDF '${OUTPUT_FILE}' ..." ps2pdf ${TEMP} ${OUTPUT_FILE} # remove temp file [ -f ${TEMP} ] && rm ${TEMP} echo "done" echo