scripts/merge-pdf/merge-pdf.sh
2021-05-20 10:29:28 +02:00

23 lines
423 B
Bash
Executable File

#!/bin/bash
while getopts ":o:output:" opt; do
case $opt in
o | output)
output=$OPTARG
shift $((OPTIND -1))
;;
*)
echo "Unsupported argument was given (only '-o' is allowed)"
exit 1
;;
esac
done
if [ -z $output ]; then
echo "An output must be provided ('-o' flag)"
exit 1
fi
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$output "${@}"