while read bugfix

This commit is contained in:
Simon Rieger 2022-02-11 14:41:22 +01:00
parent 018bebf307
commit e1d64e8bbc

View file

@ -2,6 +2,11 @@ set -x
DOKUMENT_DIR=/home/simono41/data1/Dokumente DOKUMENT_DIR=/home/simono41/data1/Dokumente
for file in $(find ${DOKUMENT_DIR} -path ${DOKUMENT_DIR}/.stversions -prune -o -name "*.pdf" ! -name '*-ocr.pdf' -print); do find ${DOKUMENT_DIR} -path ${DOKUMENT_DIR}/.stversions -prune -type f -o -name "*.pdf" ! -name '*-ocr.pdf' -print | while read file; do
ocrmypdf -l deu --force-ocr --jbig2-lossy ${file} ${file%.*}-ocr.pdf if ! [ -f "${file%.*}-ocr.pdf" ]; then
ocrmypdf -l deu --force-ocr --jbig2-lossy "${file}" "${file%.*}-ocr.pdf"
sleep 1
else
echo "Datei wurde bereits verarbeitet"
fi
done done