#!/bin/bash

YR='08'

OUTDIR=OLSReprints20${YR}
rm -rf $OUTDIR
mkdir $OUTDIR
ThisDir=$PWD
Papers=$(echo $ThisDir/*/*-proc.pdf)
cd $OUTDIR
echo PWD is $PWD
for i in $Papers ; do
  OUT=$(basename "$i" | sed -e 's/-proc\.pdf$/-Reprint.pdf/')
  echo pdftk ../Reprint.pdf "$i" cat output "$OUT"
  pdftk ../Reprint.pdf "$i" cat output "$OUT"
done
for V in 1 2 ; do
  cp -a ../Proceedings-V$V.pdf OLS20${YR}-Proceedings-V$V.pdf
  cp -a ../Proceedings-V$V.dvi OLS20${YR}-Proceedings-V$V.dvi
  cp -a ../Proceedings-V$V.ps  OLS20${YR}-Proceedings-V$V.ps 
done
cd $ThisDir

