mirror of
https://github.com/bytedream/scripts.git
synced 2025-05-09 20:25:12 +02:00
23 lines
408 B
Bash
Executable File
23 lines
408 B
Bash
Executable File
#!/bin/bash
|
|
|
|
while getopts ":o:" opt; do
|
|
case $opt in
|
|
o | output)
|
|
output=$OPTARG
|
|
;;
|
|
*)
|
|
echo "Unsupported argument was given (only '-o' is allowed)"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
shift $((OPTIND -1))
|
|
|
|
|
|
if [ -z $output ]; then
|
|
echo "An output must be provided ('-o' flag)"
|
|
exit 1
|
|
fi
|
|
|
|
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$output "${@}"
|