Annotation of /trunk/ps2pdf-extended/ps2pdf-extended.sh
Parent Directory | Revision Log
Revision 14 -
(hide annotations)
(download)
(as text)
Wed Apr 27 23:10:04 2005 UTC (19 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 782 byte(s)
Wed Apr 27 23:10:04 2005 UTC (19 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 782 byte(s)
added some cosmetics
1 | niro | 13 | #!/bin/bash |
2 | |||
3 | # -i input1,input2,.... -o output.pdf | ||
4 | |||
5 | niro | 14 | # needs ghostscript-esp-7 |
6 | niro | 13 | |
7 | usage() { | ||
8 | echo | ||
9 | niro | 14 | echo "Converts one or more postscript files to pdf" |
10 | niro | 13 | echo |
11 | echo "Usage:" | ||
12 | echo " $(basename $0) input1,input2,... output" | ||
13 | echo | ||
14 | echo "written by Niels Rogalla <niro@magellan-linux.de>" | ||
15 | echo | ||
16 | |||
17 | exit 1 | ||
18 | } | ||
19 | |||
20 | [ $# -ne 2 ] && usage | ||
21 | |||
22 | |||
23 | INPUT_FILES="$1" | ||
24 | OUTPUT_FILE="$2" | ||
25 | TEMP="/var/tmp/ps2pdf-ext-$$.ps" | ||
26 | |||
27 | niro | 14 | echo |
28 | echo "ps2pdf-extended, Niels Rogalla <niro@magellan-linux.de>" | ||
29 | echo | ||
30 | |||
31 | niro | 13 | #create a empty temp file |
32 | :> ${TEMP} | ||
33 | |||
34 | OLD_IFS="$IFS" | ||
35 | IFS="," | ||
36 | for i in ${INPUT_FILES} | ||
37 | do | ||
38 | niro | 14 | echo " Processing ${i} ..." |
39 | niro | 13 | cat ${i} >> ${TEMP} |
40 | done | ||
41 | niro | 14 | IFS="${OLD_IFS}" |
42 | niro | 13 | |
43 | niro | 14 | echo -n " Creating PDF '${OUTPUT_FILE}' ..." |
44 | niro | 13 | ps2pdf ${TEMP} ${OUTPUT_FILE} |
45 | niro | 14 | |
46 | # remove temp file | ||
47 | [ -f ${TEMP} ] && rm ${TEMP} | ||
48 | |||
49 | niro | 13 | echo "done" |
50 | echo |
Properties
Name | Value |
---|---|
svn:executable | * |