scripts/merge-pdf/merge-pdf.sh
2021-05-20 12:55:58 +02:00

23 lines
416 B
Bash
Executable File

#!/bin/bash
while getopts ":o:" 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 "${@}"