Skip to content

Instantly share code, notes, and snippets.

@tlang0
Last active October 11, 2015 11:48
Show Gist options
  • Save tlang0/3854463 to your computer and use it in GitHub Desktop.
Save tlang0/3854463 to your computer and use it in GitHub Desktop.
merges pdfs
#!/bin/sh
#
# dependencies:
# - pdfmerge
#
# how to use:
# run this script where the pdfs are
# the files will be merged in order of their names
# replace spaces
ls | while read file; do new_file=$(echo $file | sed s/\ /_/g); mv "$file" "$new_file"; done
# merge
pdfmerge `ls | grep -e "[0-9]\{1,\}.*\.pdf"` out.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment