#gostscript

utzer@social.yl.ms

Is it possible that find -exec still runs the command if there was not file found?

I am trying this:
find /home/user/folder/pdfs/ocr -type f \( -iname "*.pdf" -and -not -iname "*_ocr.pdf" \) -exec bash -c 'ocrmypdf -q -l deu+eng --rotate-pages --rotate-pages-threshold 8 -c -s "{}" /home/user/folder/pdfs/ocr_fertig/$(basename "{}" ".pdf")_ocr.pdf' \; -exec ls "{}" \;

But if there is no file in the folder then I get an error from #gostscript that origin.pdf was not defined, so I wonder how I can get exec to run the command only if at least one matching file was found?!

#Linux #find #bash #ocrmypdf