summaryrefslogtreecommitdiffstats
path: root/pdfmerge
blob: b7dd3874ca72c84ffd83a4fc2222976af4f666fa (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
# merge multiple pdfs into one

args=$(($# - 1))

if [[ $# = 0 ]] || [[ $args = 0 ]]; then
	echo "usage: ${0##*/} input.pdf [input2.pdf ..] output.pdf"
	exit 0
fi

gs -dNOPAUSE -dQUIET -dBATCH -sOutputFile=${!#} -sDEVICE=pdfwrite "${@:1:$args}"