#!/bin/bash set -e make allgraphs.pdf mkdir -vp graphs cd graphs echo "Separate pages..." pdfseparate ../allgraphs.pdf g-%d.pdf || true for f in g-[0-9]*.pdf; do n=$(pdftotext $f - | sed '\,/,!d;s, / ,-,g').pdf mv -v $f $n done