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
for file in $(find ${DOKUMENT_DIR} -path ${DOKUMENT_DIR}/.stversions -prune -o -name "*.pdf" ! -name '*-ocr.pdf' -print); do
ocrmypdf -l deu --force-ocr --jbig2-lossy ${file} ${file%.*}-ocr.pdf
done
find ${DOKUMENT_DIR} -path ${DOKUMENT_DIR}/.stversions -prune -type f -o -name "*.pdf" ! -name '*-ocr.pdf' -print | while read file; do
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