Skip to content

Instantly share code, notes, and snippets.

@riccardoscalco
Created July 6, 2019 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardoscalco/99545078bd73bec4f1af61ea16bea9d9 to your computer and use it in GitHub Desktop.
Save riccardoscalco/99545078bd73bec4f1af61ea16bea9d9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install ghostscript.
# Assume A and B have the same amount of files.
# Assume file in A are named `testo_1`, and files in B are named `disegno_1`.
END=`ls A/*.pdf | wc -l`
echo "merging..."
for (( c=1; c<=$END; c++ ))
do
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=C/report_$c.pdf A/testo_$c.pdf B/disegno_$c.pdf
done
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment