From 4e8e5f5805d1ad1c39ee02fbc747f22cbef8c13e Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 2 Nov 2016 11:41:54 +0100 Subject: [PATCH] Ensure to remove temp files. --- remove_pdf_watermark.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remove_pdf_watermark.sh b/remove_pdf_watermark.sh index 48fd379..126452e 100755 --- a/remove_pdf_watermark.sh +++ b/remove_pdf_watermark.sh @@ -21,10 +21,11 @@ if [ -f "${WATER_PDF_FILE}" ]; then command pdftk "${WATER_PDF_FILE}" output "${UNCOMPRESS_PDF_FILE}" uncompress sed -e "s/${OLD_WATER}/${NEW_WATER}/g" "${UNCOMPRESS_PDF_FILE}" >"${UNWATER_PDF_FILE}" - #sed -e "s/UNIVERSITE DE RENNES 1/TEST/g" <"${WATER_PDF_FILE}" >"${UNWATER_PDF_FILE}" command pdftk "${UNWATER_PDF_FILE}" output "${WATER_PDF_FILE}" compress + rm -f "${UNCOMPRESS_PDF_FILE}" "${UNWATER_PDF_FILE}" + exit 0 else printf '%s\n' "Error with the first arg : ${1}"