Skip to content

Instantly share code, notes, and snippets.

@zstumgoren
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save zstumgoren/a93f597651e32d32bcfd to your computer and use it in GitHub Desktop.

Select an option

Save zstumgoren/a93f597651e32d32bcfd to your computer and use it in GitHub Desktop.
merge pdf files from a directory
#!/bin/bash
pdf_files=(*.pdf)
n=1000
count=0
for ((i=0; i < ${#pdf_files[@]}; i+=n)); do
count=$((count+1));
# UPDATE DIRECTORY NAME, AS NEEDED
pdfjam "${pdf_files[@]:i:n}" -o ../FINAL-COMBINED/inbox/"$i".pdf
;
echo $count;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment